Michaels Posted February 18, 2012 Posted February 18, 2012 Hello .... Here is a link to Lee which is really very nice , and would like to add a few things to it if that possible . the link >> Doff 1- making the the first value I enter as a default number with acceptance [yes,no] 2- making the offset objects according to current layer . Hope it is possible . Thanks Quote
MSasu Posted February 18, 2012 Posted February 18, 2012 For default values on prompters please check this previous discussion. To move the result of a draw action to current layer you may try: (command "_CHPROP" (entlast) "" "_LA" (getvar "CLAYER") "") Or: (setq OldLayer (getvar "CLAYER")) ;store current layer (setvar "CLAYER" MyDrawLayer) ;switch to desired layer ; do draw actions here... (setvar "CLAYER" OldLayer) ;restore previous layer Regards, Mircea Quote
Lee Mac Posted February 18, 2012 Posted February 18, 2012 Updated version: http://lee-mac.com/doubleoffset.html Quote
Michaels Posted February 19, 2012 Author Posted February 19, 2012 Thanks Mircea for your idea , Thanks Lee , that works very nice . (although that I hoped it uses multiple selection set ) Thank you so much . Quote
Lee Mac Posted February 19, 2012 Posted February 19, 2012 Double-Offset: (defun c:dOff ( / doc sel ) (if (and (ssget "_:L" '((0 . "ARC,CIRCLE,ELLIPSE,*LINE"))) (setq *of (cond ((getdist (strcat "\nSpecify Offset" (if *of (strcat " <" (rtos *of) ">: ") ": ")))) (*of))) ) (progn (vla-startundomark (setq doc (vla-get-activedocument (vlax-get-acad-object)))) (vlax-for obj (setq sel (vla-get-activeselectionset doc)) (foreach off (list *of (- *of)) (vl-catch-all-apply 'vla-offset (list obj off))) ) (vla-delete sel) (vla-endundomark doc) ) ) (princ) ) (vl-load-com) (princ) Double-Offset to Current Layer: (defun c:dOffc ( / doc lay sel ) (if (and (ssget "_:L" '((0 . "ARC,CIRCLE,ELLIPSE,*LINE"))) (setq *of (cond ((getdist (strcat "\nSpecify Offset" (if *of (strcat " <" (rtos *of) ">: ") ": ")))) (*of))) ) (progn (setq lay (getvar 'CLAYER)) (vla-startundomark (setq doc (vla-get-activedocument (vlax-get-acad-object)))) (vlax-for obj (setq sel (vla-get-activeselectionset doc)) (foreach off (list *of (- *of)) (if (not (vl-catch-all-error-p (setq err (vl-catch-all-apply 'vlax-invoke (list obj 'offset off))))) (foreach obj err (vla-put-layer obj lay)) ) ) ) (vla-delete sel) (vla-endundomark doc) ) ) (princ) ) (vl-load-com) (princ) Quote
Michaels Posted February 19, 2012 Author Posted February 19, 2012 That is great Lee . Thank you so much . Michaels 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.