AutoCAD 2010/2011/2012 DWG Format
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Continuous Lisp Command
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I currently use the lisp command below for freezing layers.... But after I select the object I want to freeze I have to enter into the command again.... Is there anyway to have this command continuously loop until I am done using it?
(defun C:FL ( / layer)
(setq layer
(cdr
(assoc 8
(entget
(car
(entsel "Pick Item to freeze layer "))))))
(command "layer" "freeze" layer "")
Thank You,
MRL
Solved! Go to Solution.
Re: Continuous Lisp Command
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Check out this site. Has everytihing you need. http://www.afralisp.net/
AutoCAD 2012
Dell Precision T7400, Intel Xeon @3.4GHz
Win XP 32bit 4GB RAM
Nvidia Quadro FX 3700
Cyborg R.A.T. 7 mouse
Re: Continuous Lisp Command
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Enter a "while" is T (true) in the lisp and it should loop until you cancel the command. Look into the AutoLISP help files for more info.
Re: Continuous Lisp Command
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
So what would the lisp command look like then... would you edit mine to what it would be??
Thank you
MRL
Re: Continuous Lisp Command
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
How much money you got to give? Remember how much of a time-saver this will be today and in the future before you give an answer!!!!!
Just kidding, here you go.
(defun C:FL ( / layer)
(while T
(setq layer (cdr (assoc 8 (entget (car (entsel "Pick Item to freeze layer "))))))
(command "layer" "freeze" layer "")
); end while
); end Fl.lsp
Just hit the escape key when done with your picks. Have fun.
Re: Continuous Lisp Command
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thanks to both of you guys for the responses. the command works great like a freaking charm...and the website perfect for guidance... however I am sure I will have more....
Thank you both again.
MRL
Re: Continuous Lisp Command
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Your original code wasn't working because you've made the LAYER variable 'local', that way LISP won't remember it when the FL routine finishes.
Anyway, the code with While is much better.
Consultant Plant Design Software
Greenock CAD Service
