Jump to content

chamfer dimensions! how to do?


lucas3

Recommended Posts

  • Replies 37
  • Created
  • Last Reply

Top Posters In This Topic

  • lucas3

    19

  • ReMark

    15

  • Lee Mac

    2

  • Tharwat

    2

Top Posters In This Topic

Posted Images

Mouse click on the chamfer line , automatic dimensions chamfer size

Support Pline, line,

 

[ATTACH=CONFIG]45905[/ATTACH]

 

 

help!who can help me? thank you!

Link to comment
Share on other sites

I don't think he has any code. I also think the OP is using CADTutor to answer questions at a bulletin board that he is involved with (i.e. - he's asking on behalf of other people).

Link to comment
Share on other sites

What code do you have so far that you need help with?

 

Hi lee,Thank you for your reply!

(defun c:tt (/            en           en_data         pt0        endpt1 endpt2 cjsl
            endpt1x           endpt1y         endpt2x       endpt2y
            dinpt  cl           cl1          cl2         txt        pt3    pt4    pt3x
            ang1   pt5           pt6          pt6x         l        pt7    ang2   l1
            n            l2           th          pt8         pt9        pt10   ggg v2 v3
           os)
 (setq        olderr        *error*
       *error*        myerr
 )
(vl-load-com)
 (setq os (getvar "osmode"))                
 (setq v2 (getvar "dimstyle"))
 (setq v3 (getvar "blipmode"))                
 (setvar "osmode" 0)                        
 (setvar "cmdecho" 0)                      
 (setvar "blipmode" 0)                     
 (graphscr)                                
 (setq en (entsel "\nChoose chamfer edge!"))
 (setq en_data (entget (car en)))
 (setq pt0 (list (car (cadr en)) (cadr (cadr en))))
 (setq        endpt1 (list (car (cdr (assoc 10 en_data)))
                    (cadr (cdr (assoc 10 en_data)))
              )
 )
 (setq        endpt2 (list (car (cdr (assoc 11 en_data)))
                    (cadr (cdr (assoc 11 en_data)))
              )
 )
 (setq endpt1x (car (cdr (assoc 10 en_data))))
 (setq endpt1y (cadr (cdr (assoc 10 en_data))))
 (setq endpt2x (car (cdr (assoc 11 en_data))))
 (setq endpt2y (cadr (cdr (assoc 11 en_data))))
 (setq dinpt (list endpt1x endpt2y))
 (setq cl (distance endpt1 dinpt))
 (setq cl3 (distance endpt2 dinpt))
 (setvar "dimdec" 2)
 (setvar "dimzin" 
 (if (equal cl cl3 0.05)
   (progn
       (setvar "dimzin" 
     (setq cjsl (getstring "\nInput Quantity!"))
     (setq cl2 (rtos cl ))
     (setq ggg "-")
     (if (or (= cjsl "") (= cjsl nil))
       (setq ggg "")
     )
     (setq txt (strcat cjsl ggg "C" cl2))
     (setq pt3        (list (car (osnap pt0 "endpoint"))
                     (cadr (osnap pt0 "endpoint"))
               )
     )                                        
     (setq pt4        (list (car (osnap pt0 "midpoint"))
                     (cadr (osnap pt0 "midpoint"))
               )
     )                                       
     (setq pt3x (car pt3))
     (setq ang1 (angle pt4 pt3))        
     (vl-cmdf "ortho" "off")
     (setq pt5 (getpoint pt3 "\nChoose placement")) ;
     (setq pt6 (list (car pt5) (cadr pt5))) ;
     (setq pt6x (car pt6))                ;
     (setq l (distance pt3 pt6))        ;
     (setq pt7 (polar pt3 ang1 l))
     (setq ang2 (cond ((> pt6x pt3x) 0)
                      ((< pt6x pt3x) pi)
                      (t 0)
                )
     )
     (setq l1 (strlen txt))
     (setq n (getvar 'dimscale))
     (setq l2 (* l1 n 2))
     (setq th (* 3 n))
     (setq pt8 (polar pt7 ang2 l2))
     (if (not (tblsearch "LAYER" "dim"))
       (vl-cmdf "layer" "m" "dim" "c" "7" "" "l" "continuous" "" "")
     )
     (setvar "clayer" "dim")
     (vl-cmdf "pline" pt3 pt7 pt8 "")
     (setq pt9 (osnap pt8 "midpoint"))
     (setq pt10 (polar pt9 (/ pi 2) (/ th 2)))
     (if (not (tblsearch "style" "gb"))
       (vl-cmdf "style" "GB" "gbenor,gbcbig" "" "1" "" "" "")
     )
     (vl-cmdf "text" "s" "gb" "j" "m" pt10 th 0 txt)
   )
   (progn
       (setvar "dimzin" 
     (setq cl2 (rtos cl))
     (setq cl4(rtos cl3))
     (setq ggg "x")
     (setq txt (strcat cl2 ggg cl4))
     (setq pt3        (list (car (osnap pt0 "endpoint"))
                     (cadr (osnap pt0 "endpoint"))
               )
     )                                        ;
     (setq pt4        (list (car (osnap pt0 "midpoint"))
                     (cadr (osnap pt0 "midpoint"))
               )
     )                                        ;
     (setq pt3x (car pt3))
     (setq ang1 (angle pt4 pt3))        ;
(vl-cmdf "ortho" "off")
     (setq pt5 (getpoint pt3 "\nChoose placement")) ;
     (setq pt6 (list (car pt5) (cadr pt5))) ;
     (setq pt6x (car pt6))                ;
     (setq l (distance pt3 pt6))        ;
     (setq pt7 (polar pt3 ang1 l))
     (setq ang2 (cond ((> pt6x pt3x) 0)
                      ((< pt6x pt3x) pi)
                      (t 0)
                )
     )
     (setq l1 (strlen txt))
     (setq n (getvar 'dimscale))
     (setq l2 (* l1 n 2))
     (setq th (* 3 n))
     (setq pt8 (polar pt7 ang2 l2))
     (if (not (tblsearch "LAYER" "dim"))
       (vl-cmdf "layer" "m" "dim" "c" "7" "" "l" "continuous" "" "")
     )
     (setvar "clayer" "dim")
     (vl-cmdf "pline" pt3 pt7 pt8 "")
     (setq pt9 (osnap pt8 "midpoint"))
     (setq pt10 (polar pt9 (/ pi 2) (/ th 2)))
     (if (not (tblsearch "style" "gb"))
       (vl-cmdf "style" "GB" "gbenor,gbcbig" "" "1" "" "" "")
     )
     (vl-cmdf "text" "s" "gb" "j" "m" pt10 th 0 txt)

   )
 )
 (vl-cmdf "-dimstyle" "r" v2)
 (setvar "blipmode" v3);
 (PRINT)
 (prompt "Chamfer dimension")
 (myerr)
 (princ)                                ;
)
(defun myerr (msg)
 (setvar "osmode" os)
 (setq *error* olderr)
 (princ)

)

Link to comment
Share on other sites

I don't think he has any code. I also think the OP is using CADTutor to answer questions at a bulletin board that he is involved with (i.e. - he's asking on behalf of other people).

 

 

Helping others can make yourself happy,Autolisp Not I'm good at, But I humbly ask!

Link to comment
Share on other sites

I also think the OP is using CADTutor to answer questions at a bulletin board that he is involved with (i.e. - he's asking on behalf of other people).

 

Unfortunately, I think you are right ReMark:

 

http://bbs.mjtd.com/thread-99808-1-1.html

As for the author, it would appear that this header has been removed:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                                                         ;;;
;;;  ShangHai zhiren Mould Industry Co. Ltd.                ;;;
;;;                    xiangzanyang  (aug,2012)             ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Link to comment
Share on other sites

Unfortunately, I think you are right ReMark:

 

http://bbs.mjtd.com/thread-99808-1-1.html

As for the author, it would appear that this header has been removed:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                                                         ;;;
;;;  ShangHai zhiren Mould Industry Co. Ltd.                ;;;
;;;                    xiangzanyang  (aug,2012)             ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 

Lee,you are right !I deleted the redundant content is for A better view ,Original code have some Chinese, May cause garbled,so I edited!

Link to comment
Share on other sites

I wonder who the OP is really trying to help here?

 

lucas: Are you interested in learning to write your own lisp programs?

 

 

Of course I wanted to learn

Link to comment
Share on other sites

Not necessarily. It might just be that there aren't a lot of forum members around today since yesterday was a holiday for most and some people extend it by a few days. Maybe they are sleeping late today.

Link to comment
Share on other sites

Not necessarily. It might just be that there aren't a lot of forum members around today since yesterday was a holiday for most and some people extend it by a few days. Maybe they are sleeping late today.

 

That code BY向赞扬 ,not support Pline and not beautiful,I need QLEADER :(

Link to comment
Share on other sites

So you want a leader with an arrowhead and you want the arrowhead to start at the midpoint of the chamfer and not at one end or the other. Is that correct?

Link to comment
Share on other sites

So you want a leader with an arrowhead and you want the arrowhead to start at the midpoint of the chamfer and not at one end or the other. Is that correct?

 

YES, like autodesk inventor

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...