Civil 3D, Select Objects by Object Data
Civil 3D, Select Objects by Object Data
(OP)
I have been going crazy trying to figure out how to do this. I would like a LISP routine, called "SELECTOD", which would select all items on the current layer that have a certain field value set in their Object Data. It would presumably need to prompt for the field name and value. Everything on the current layer that has this field name and value would then be selected. I could then do as I wish with it: delete it, move it to another layer, etc. I can't figure out how to tell the ssget command to use the current layer without specifying its name, and I can't figure out how to tell it the attribute name and value to filter by. Or should I be using something besides the ssget command? I would be grateful for the help, thanks!





RE: Civil 3D, Select Objects by Object Data
An example to select everything on current layer;
(setq CurLayer(getvar "clayer"))
(setq ss (ssget "x" (list (cons 8 CurLayer))))
Not sure what you mean by object data, so this method might not necessarily be expanded to do what you want...
RE: Civil 3D, Select Objects by Object Data
(Defun C:SELECTOD ()
(setq CurLayer(getvar "clayer"))
(setq ss (ssget "x" (list (cons 8 CurLayer))))
(sssetfirst nil ss)
(princ))
Now if only I could figure out how to filter this set according to the value of an object data field. Object data are custom properties that can be assigned to objects in Civil 3D, and perhaps other AutoCAD flavors also. Thanks.
RE: Civil 3D, Select Objects by Object Data