Tharwat Posted January 20, 2015 Posted January 20, 2015 Use the same apply that I did for changing the linweight . eg. (if (and (eq (vla-get-objectname (car x)) "AcDbCircle") (eq (vla-get-linetype (car x)) "Continuous") ) (vla-put-lineweight [color="red"](car x)[/color] acLnWt035) ) One more thing , as I have reminded you earlier that there was a simple typo in my last reply and anyway I corrected here in this post as highlighted in RED above Quote
cadfan Posted January 20, 2015 Author Posted January 20, 2015 Use the same apply that I did for changing the linweight . eg. (if (and (eq (vla-get-objectname (car x)) "AcDbCircle") (eq (vla-get-linetype (car x)) "Continuous") ) (vla-put-lineweight [color="red"](car x)[/color] acLnWt035) ) One more thing , as I have reminded you earlier that there was a simple typo in my last reply and anyway I corrected here in this post as highlighted in RED above Thank you .Mr.Tharwat Ability is limited, can't understand . can you help me this time ? Quote
Tharwat Posted January 20, 2015 Posted January 20, 2015 The following codes to create objects as implemented into your codes . (setq cir (vlax-invoke space 'addcircle pcen r) arc (vlax-invoke space 'addarc pcen mr 4.71239 3.14159) ln1 (vlax-invoke space 'addline p1 p3) ln2 (vlax-invoke space 'addline p2 p4) ) Where variables : cir = circle arc = arc ln1 = first line ln2 = second line Then use the following method to move circle to a specific layer that should be existed in your drawing ; (vla-put-layer cir "screw") And the same should be used to any other objects . Quote
cadfan Posted January 20, 2015 Author Posted January 20, 2015 (edited) The following codes to create objects as implemented into your codes . (setq cir (vlax-invoke space 'addcircle pcen r) arc (vlax-invoke space 'addarc pcen mr 4.71239 3.14159) ln1 (vlax-invoke space 'addline p1 p3) ln2 (vlax-invoke space 'addline p2 p4) ) Where variables : cir = circle arc = arc ln1 = first line ln2 = second line Then use the following method to move circle to a specific layer that should be existed in your drawing ; (vla-put-layer cir "screw") And the same should be used to any other objects . Thank , Mr.Tharwat. (setq cir (vlax-invoke space 'addcircle pcen r) arc (vlax-invoke space 'addarc pcen mr 4.71239 3.14159) ln1 (vlax-invoke space 'addline p1 p3) ln2 (vlax-invoke space 'addline p2 p4) ) [color="red"] (vla-put-layer ln1 "centreline") (vla-put-layer ln2 "centreline")[/color] (mapcar '(lambda (x) (vlax-put (car x) 'layer "screw") (vlax-put (car x) 'color (cadr x)) (vlax-put (car x) "linetype" (caddr x)) (vlax-put (car x) "linetypescale" xk) ) (list (list cir 33 cel) (list arc 3 cel) (list ln1 1 "center") (list ln2 1 "center") ) ) Edited January 20, 2015 by cadfan Quote
marko_ribar Posted January 20, 2015 Posted January 20, 2015 Another... (defun c:tt (...) (defun _make (...) ... (setq cir (vlax-invoke space 'addcircle pcen r) arc (vlax-invoke space 'addarc pcen mr 4.71239 3.14159) ln1 (vlax-invoke space 'addline p1 p3) ln2 (vlax-invoke space 'addline p2 p4) ) (mapcar '(lambda (x) (vlax-put (car x) 'layer [color=red](cadr x)[/color]) (vlax-put (car x) 'color [color=red](caddr x)[/color]) (vlax-put (car x) "linetype" [color=red](cadddr x)[/color]) (vlax-put (car x) "linetypescale" xk) (if (and (eq (vla-get-objectname (car x)) "AcDbCircle") (eq (vla-get-linetype (car x)) "Continuous") ) (vla-put-lineweight (car x) acLnWt035) ) ) (list [color=red](list cir "screw" 33 cel) (list arc "screw" 3 cel) (list ln1 "centreline" 1 "center") (list ln2 "centreline" 1 "center")[/color] ) ) (if (member "isText" slst) (progn (setq txt (vlax-invoke space 'AddText str pcen (* mr 0.4))) (vla-put-alignment txt acAlignmentTopCenter) (vla-put-textalignmentpoint txt (vlax-3d-point (polar pcen (- _pi2) (* mr 0.17))) ) [color=red](vla-put-layer txt "text") [/color] ) ) (if (member "isBlock" slst) (vlax-invoke (fy:acspace) 'insertblock pcen (vla-get-name space) 1. 1. 1. 0. ) ) ) ... (if (and (= (xd::dcl:start id fn) 1 ) (setq ss (ssget '((0 . "circle") (-4 . "<or") (40 . 2.5) (40 . 3.3) (40 . 4.2) (40 . 5.0) (40 . 6. (40 . 8.5) (40 . 10.5) (40 . 12.0) (40 . 14.0) (40 . 15.5) (40 . 17.5) (-4 . "or>") ) ) ) ) (progn (if (not (tblsearch "style" "txt")) (command ".style" "txt" "txt.shx,gbcbig.shx" 0.0 1.0 0.0 "n" "n" "n" ) ) (if (not (tblsearch "ltype" "hidden")) (vla-load (fy:acltypes) "hidden" "acadiso.lin") ) (if (not (tblsearch "ltype" "center")) (vla-load (fy:acltypes) "center" "acadiso.lin") ) (if (not (tblsearch "layer" "screw")) (vla-add (fy:aclayers) "screw") ) [color=red](if (not (tblsearch "layer" "centreline")) (vla-add (fy:aclayers) "centreline") ) (if (not (tblsearch "layer" "text")) (vla-add (fy:aclayers) "text") )[/color] (mapcar '(lambda (x) (_make x)) (fy:cset->objs)) (if (member "isErased" slst) (command ".erase" ss "") ) ) ) (princ) ) Quote
cadfan Posted January 20, 2015 Author Posted January 20, 2015 (edited) Another... , Thank you ,marko. I will read carefully . TKS. Edited January 20, 2015 by cadfan Quote
cadfan Posted January 20, 2015 Author Posted January 20, 2015 Another... Hi marko . This modify is most beautiful . (mapcar '(lambda (x) (vlax-put (car x) 'layer [color="red"](cadr x)[/color]) (vlax-put (car x) 'color [color="red"](caddr x)[/color]) (vlax-put (car x) "linetype" [color="red"](cadddr x)[/color]) (vlax-put (car x) "linetypescale" xk) (if (and (eq (vla-get-objectname (car x)) "AcDbCircle") (eq (vla-get-linetype (car x)) "Continuous") ) (vla-put-lineweight (car x) acLnWt035) ) ) (list [color="red"](list cir "screw" 33 cel)[/color] [color="red"] (list arc "screw" 3 cel)[/color] [color="red"] (list ln1 "centreline" 1 "center")[/color] [color="red"] (list ln2 "centreline" 1 "center")[/color] ) ) Now , All problems have been solved ! Many thanks! Tharwat, Marko. Quote
Recommended Posts
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.