brengine
Mechanical
- Apr 19, 2001
- 616
I'd like to take the LayerIsolate lisp routine from the Express Tools and modify it. We use 4 layers for one component, we call them layer groups. So for the component 1, the 4 actual layers needed to show the part are: layer 1s is solid lines only, layer 1c is centerlines only, layer 1h is hidden lines only, and layer 1p is phantom lines only. I would like to control the visibility of each group all together.
So what I want is a LayerIsolateGroup routine that will look at the selected items, and keep those layers on as well as the ?s, ?c, ?h, and ?p layers for each selection.
Here's the code to get the graphical selections:
Any idea how to add the additional layer names to LAYLST (or maybe LAY...I'm not really sure but I think LAYLST)? I think that is what I want to do because later in the code are these 3 lines:
I've also found this to check whether a layer exists (NEWLAYER in this example):
(setq flag (tblsearch "LAYER" "NEWLAYER"))
And this for the string length:
strlen
Thanks,
Ken
So what I want is a LayerIsolateGroup routine that will look at the selected items, and keep those layers on as well as the ?s, ?c, ?h, and ?p layers for each selection.
Here's the code to get the graphical selections:
Code:
(if (not (setq SS (ssget "_i")))
(progn
(prompt "\nSelect object(s) on the layer(s) to be isolated: ")
(setq SS (ssget))
)
)
(if SS
(progn
(setq CNT 0)
(while (and ss
(> (sslength ss) 0)
(setq LAY (ssname SS CNT))
);and
(setq LAY (cdr (assoc 8 (entget LAY))))
(if (not (member LAY LAYLST))
(setq LAYLST (cons LAY LAYLST))
)
(setq CNT (1+ CNT))
)
Any idea how to add the additional layer names to LAYLST (or maybe LAY...I'm not really sure but I think LAYLST)? I think that is what I want to do because later in the code are these 3 lines:
Code:
(command "_.-LAYER" "_OFF" "*" "_Y")
(foreach VAL LAYLST (command "_ON" VAL))
(command "")
I've also found this to check whether a layer exists (NEWLAYER in this example):
(setq flag (tblsearch "LAYER" "NEWLAYER"))
And this for the string length:
strlen
Thanks,
Ken