Jump to content

Recommended Posts

Posted

Hi All,

 

I have this little lisp routine i run for creating revision clouds. I have it set up so i can turn any closed polyline object into my preset cloud layer with correct arc lengths etc. After its run it always changes my current layer to the one specified in the code below (rev 000 all) and i'd rather it not do that. I know the code is 'setting' the layer first, not sure how to amend so i can switch back to previous layer. Or if keeping current layer isn't easy, switching to layer '0' at the end would also be handy..

 

Any help greatly appreciated!

 

(defun c:rc  () (command "-LAYER" "S" "rev 000 all"  "tr" "50" "" "" "revcloud" "A" "700" "700" "o" pause ""))

 

Posted

Use a variable to store your current layer first. Get it using getvar and setvar:

 

(defun c:rc ( / ly)
    (setq ly (getvar "clayer"))
    (command "-LAYER" "S" "rev 000 all"  "tr" "50" "" "" "revcloud" "A" "700" "700" "o" pause "")
    (setvar "clayer" ly)
    (princ)
)

 

  • Agree 1
Posted

thats absolutely perfect..

i love this place. you guys are so unbelievably helpful.

cadtutor community ftw!!

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...