The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Hurricane for AutoCAD
 General Discussion
 Filtering for layers using scripts

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Attach a File

Check here to subscribe to this topic.
   

T O P I C    R E V I E W
TestSubject Posted - August 07 2003 : 09:49:08 AM
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?
4   L A T E S T    R E P L I E S    (Newest First)
Admin Posted - August 08 2003 : 1:48:40 PM
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

TestSubject Posted - August 08 2003 : 11:08:38 AM
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.
Admin Posted - August 07 2003 : 3:00:24 PM
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
TestSubject Posted - August 07 2003 : 10:00:22 AM
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...>

The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.17 seconds. Snitz Forums 2000