The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Hurricane for AutoCAD
 General Discussion
 Filtering for layers using scripts
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

TestSubject
New Member



6 Posts

Posted - August 07 2003 :  09:49:08 AM  Show Profile  Visit TestSubject's Homepage  Reply with Quote
I am having the hardest time finding out how to select all on Layer 0 from within a script. This has to have been done before.

Anyone have any clues?

TestSubject
New Member



6 Posts

Posted - August 07 2003 :  10:00:22 AM  Show Profile  Visit TestSubject's Homepage  Reply with Quote
I think I may have found a way around this. If you lock the layers that you don't want to change, then they won't be selected when you select "all". Kind of a kludge, but it works. <can't understand not having a command line filter available...>
Go to Top of Page

Admin
Administrator



652 Posts

Posted - August 07 2003 :  3:00:24 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Hi Testsubject,

Have you tried the command "SSX"? This might be another alternative for you... if not in this situation, maybe another!

(I've just looked in the A2K2, and A2K4 and it seems that this lisp was not included!... It was standard in R14 I believe... I have attached it for your convenience...)

Download Attachment: SSX.zip
3.28 KB

Regards,
Bill

Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page

TestSubject
New Member



6 Posts

Posted - August 08 2003 :  11:08:38 AM  Show Profile  Visit TestSubject's Homepage  Reply with Quote
SSX is available in 2002. maybe it is hardcoded now and not a lisp. I did try it and it only works for like objects. So if I have text, circles and lines, I have to grab each individually to move them.
Go to Top of Page

Admin
Administrator



652 Posts

Posted - August 08 2003 :  1:48:40 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Here are a couple of lisp routines that I found on the net, they can help you out.


;;;******************************************************************
;;; lay01   Freeze all  (comand line)
;;; Isolates a single layer chosen from the command line
(defun c:fall (/ layname) 
(setq layname (getstring "
 Please enter the name of the layer: ")) 
(command "_LAYER" "s" layname "") ;sets chosen layer to current layer 
(command "_LAYER" "f" "*" "");freezes all layers except the current layer 
(princ)  ;exits quietly 
 ) 
;;;******************************************************************
;;; lay02   Freeze all  (screen)
;;; Isolates a single layer by choosing an object on that layer from the screen 
;;; and freezing all layers except the one chosen from the screen 
(defun c:fall (/ layname)
(setq layname
(assoc 8(entget(car(entsel "
 Please choose an object to isolate: ")))))
;;; selects an object with entsel, uses car to extract the object's name
;;; gets an entity list with entget, uses assoc to extract the layer name
(command "_LAYER" "s" layname "") ;sets chosen layer to current layer 
(command "_LAYER" "f" "*" "") ;freezes all layers except the current layer 
(princ)  ;exits quietly
 )
;;;******************************************************************
;;; lay03   Thaw all
;;; Thaws all layers
(defun c: tall (  )
(command "_LAYER" "t" "*" "")  ;thaws all layers
(princ)  ;exits quietly
 )
;;;******************************************************************


These can be converted to strictly script routines, rather than lisp, example code here sets layer 0 as current, then freezes everything (*) else.

;Begin script
-LAYER
S
0
F
*

;End Script

Then you can select ALL, and do whatever you need to do.

Hope this helps!
Bill


Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.3 seconds. Snitz Forums 2000