michaeloureiro Posted December 19, 2008 Share Posted December 19, 2008 Hey all, does anybody know of lisp that can offset to the current layer, or layer of choice? thanks in advance! Quote Link to comment Share on other sites More sharing options...
tzframpton Posted December 19, 2008 Share Posted December 19, 2008 Hey all, does anybody know of lisp that can offset to the current layer, or layer of choice? thanks in advance! I believe the OFFSET command already does this. Command: offset Specify offset distance or [Through/Erase/Layer] Quote Link to comment Share on other sites More sharing options...
GhostRider Posted December 19, 2008 Share Posted December 19, 2008 YEP, and here's one from another thread: ;Offset to current layer...excellent program. (DeFun C:OSET1 (/ LAYER ECHO TEMP ENTITY) (SetQ LAYER (GetVar "CLayer") ECHO (GetVar "CmdEcho")) (SetVar "CmdEcho" 0) (While (ProgN (SetQ TEMP (GetString (StrCat "\nDestination layer? <"LAYER">:"))) (Cond ((Eq TEMP "") Nil) ((TblSearch "LAYER" TEMP) (SetQ LAYER TEMP) Nil) (T (PrinC "\nLayer not found.")) ))) (InitGet (+ 2 4) "Through") (SetQ TEMP (GetDist (StrCat "\nOffset distance or Through <" (If DIST (RToS DIST) "Through") ">: "))) (Cond ((Eq TEMP "Through") (SetQ DIST Nil)) (TEMP (SetQ DIST TEMP)) ) (SetQ TEMP (If DIST "\nSide to offset?" "\nThrough point: ")) (While (And (SetQ ENTITY (EntSel "\nSelect object to offset: ")) (SetQ PT (GetPoint TEMP)) ) (Command ".OFFSET" (If DIST DIST "T") ENTITY PT "") (SetQ ENTITY (EntLast) ENTITY (EntGet ENTITY) ENTITY (SubSt (Cons 8 LAYER) (Assoc 8 ENTITY) ENTITY)) (EntMod ENTITY) ) (SetVar "CmdEcho" ECHO) (PrinC) ) Quote Link to comment Share on other sites More sharing options...
michaeloureiro Posted December 19, 2008 Author Share Posted December 19, 2008 thanks guys Quote Link to comment Share on other sites More sharing options...
VVA Posted December 21, 2008 Share Posted December 21, 2008 EXOFFSET from Express Tools Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 21, 2008 Share Posted December 21, 2008 EXOFFSET from Express Tools Yeah, I like that tool - good for multiple offsets also. :wink: Quote Link to comment Share on other sites More sharing options...
dblclkmatt Posted December 2, 2013 Share Posted December 2, 2013 Is there a way to offset an object to the source layer, but change the original object to a different layer, all in the same motion? Quote Link to comment Share on other sites More sharing options...
dblclkmatt Posted December 5, 2013 Share Posted December 5, 2013 Is there a way to offset an object to the source layer, but change the original object to a different layer, all in the same motion? Is this at all possible? I like the code that GhostRider suggest and I've been tweaking it to attempt these results, but I'm no programmer, so it's not surprising I've had no luck. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 5, 2013 Share Posted December 5, 2013 Here is a very simple example: (defun c:myoffset ( / ent off ) (if (and (setq ent (car (entsel "\nSelect object to offset: "))) (setq off (getdist "\nSpecify offset distance: ")) ) (if (vl-cmdf "_.offset" "_L" "_S" off ent "\\" "") (entmod (subst '(8 . "YourLayerHere") (assoc 8 (setq ent (entget ent))) ent)) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
dblclkmatt Posted December 5, 2013 Share Posted December 5, 2013 Here is a very simple example: (defun c:myoffset ( / ent off ) (if (and (setq ent (car (entsel "\nSelect object to offset: "))) (setq off (getdist "\nSpecify offset distance: ")) ) (if (vl-cmdf "_.offset" "_L" "_S" off ent "\\" "") (entmod (subst '(8 . "YourLayerHere") (assoc 8 (setq ent (entget ent))) ent)) ) ) (princ) ) Excellent! Worked perfectly! Thank you Lee Mac! Quote Link to comment Share on other sites More sharing options...
motee-z Posted December 5, 2013 Share Posted December 5, 2013 hello can be pick object to get its layer and set it for offset layer Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 5, 2013 Share Posted December 5, 2013 Excellent! Worked perfectly! Thank you Lee Mac! You're welcome! can be pick object to get its layer and set it for offset layer Here is a very simple program, assuming I have understood your intention: (defun c:myoffset ( / ent lay old ) (if (setq ent (car (entsel "\nPick object for offset layer: "))) (progn (setq lay (cdr (assoc 8 (entget ent))) old (getvar 'clayer) ) (vl-cmdf "_.-layer" "_T" lay "_S" lay "" "_.offset" "_L" "_C") (while (= 1 (logand 1 (getvar 'cmdactive))) (vl-cmdf "\\")) (setvar 'clayer old) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
motee-z Posted December 5, 2013 Share Posted December 5, 2013 thanks lee for reply but what i mean is the same lisp you have wrot it befor but instead of typing layer in the code to pick known object for me and get its layer and make the offset object move to the same layer of object i have picked sequence of commands pick object for offset -enter offset value -pick object to get its layer loop here -offset done to the picked layer Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 5, 2013 Share Posted December 5, 2013 thanks lee for reply but what i mean is the same lisp you have wrot it befor but instead of typing layer in the code to pick known object for me and get its layer and make the offset object move to the same layer of object i have picked Just use the OFFSET > LAYER > SOURCE option of the offset command? Quote Link to comment Share on other sites More sharing options...
motee-z Posted December 6, 2013 Share Posted December 6, 2013 thanks lee that is okay Quote Link to comment Share on other sites More sharing options...
dblclkmatt Posted December 9, 2013 Share Posted December 9, 2013 Excellent! Worked perfectly! Thank you Lee Mac! I do have a tweak if possible, can you change it to prompt the offset first, then the object? And maintain the ability to choose additional objects after offsetting the first? Similar to the natural function of the offset command. Quote Link to comment Share on other sites More sharing options...
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.