View Full Version : Creating Selection Set
todd.mackay
2005-10-07, 01:39 PM
I'm trying to create a selection set for all objects (in a drawing) that have a "continuous" linetype. The goal is to have everything on that linetype to change to one layer (OBJ) then to set the their color and linetype to "Bylayer." Currently, all the objects in the drawing are on multiple layers with their color set to "white" and linetype set to "continuous."
I tried this in the Visual LISP Console:
(ssget sstry (ssget "X" (list (cons 7 "continuous"))))
and got:
error: bad point argument
The (cons 7 "continuous") part was a shot in the dark and I tried looking in the developers help but couldn't find too much by looking under "cons." Does anyone have any tips on good ways to search when encountering problems like this (for beginners)? Other then writing to you wonderful people in the forums. Or is the answer that you just have to get better with experience?
Thanks
Mike.Perry
2005-10-07, 02:07 PM
Does anyone have any tips on good ways to search when encountering problems like this (for beginners)? Other then writing to you wonderful people in the forums. Or is the answer that you just have to get better with experience?Hi
Check out the following Submission # EX001011 by Ed Jobe & EX001070 by Peter Jamtgaard on the AUGI Exchange Page -
AUGI Exchange Search Page (http://www.augi.com/exchange/search.asp?page=415)
Both of them routines should prove very useful in helping retrieve Entity / Object data.
Have a good one, Mike
peter
2005-10-07, 03:17 PM
(defun C:LinetypetoLayer (/ intCount entSelection lstEntity objSelection ssSelections )
(vl-load-com)
(if (not (tblsearch "layer" "Continuous"))
(vl-cmdf "-layer" "m" "Continuous" "")
)
(setq ssSelections (ssget "X" (list (cons 6 "Continuous"))))
(repeat (setq intCount (sslength ssSelections))
(setq intCount (1- intCount)
entSelection (ssname ssSelections intCOunt)
objSelection (vlax-ename->vla-object entSelection)
)
(vla-put-linetype objSelection "ByLayer")
(vla-put-layer objSelection "Continuous")
)
(princ)
)
I'm trying to create a selection set for all objects (in a drawing) that have a "continuous" linetype. The goal is to have everything on that linetype to change to one layer (OBJ) then to set the their color and linetype to "Bylayer." Currently, all the objects in the drawing are on multiple layers with their color set to "white" and linetype set to "continuous."
I tried this in the Visual LISP Console:
(ssget sstry (ssget "X" (list (cons 7 "continuous"))))
and got:
error: bad point argument
The (cons 7 "continuous") part was a shot in the dark and I tried looking in the developers help but couldn't find too much by looking under "cons." Does anyone have any tips on good ways to search when encountering problems like this (for beginners)? Other then writing to you wonderful people in the forums. Or is the answer that you just have to get better with experience?
Thanks
I'm not sure if you found what you are looking for yet, but the example you provided has a few errors.
(ssget sstry (ssget "X" (list (cons 7 "continuous"))))
First thing. The item in red should be setq instead of ssget. You are trying to execute the ssget function instead of setting the value of the variable sstry.
Next. The group code 7 is for the Text style name. You are not trying to get the text style. You will need to use the linetype group code of 6.
[quote=6 Linetype name (fixed)
7 Text style name (fixed)[/quote]
The following code will find all entities where the linetype is changed to the CONTINUOUS linetype. This will not find entities that have a linetype of bylayer with the layer's linetype set to CONTINUOUS.
(setq sstry (ssget "X" (list (cons 6 "CONTINUOUS"))))
HTH
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.