The string below was working, but now I get the following error:
Command: ; error: bad function: T
Just trying to automate exploding leaders and dims in a detail formatting tool.
(if (setq DIM (ssget "x" '((-4 . "<or") (0 . "DIMENSION") (0 . "LEADER") (-4 . "or>")))) ((initcommandversion) (vl-cmdf "_explode" DIM))) (while (setq DIM (ssget "x" '((-4 . "<or") (0 . "DIMENSION") (0 . "LEADER") (-4 . "or>")))) ((initcommandversion) (vl-cmdf "_explode" DIM "")))
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
I don't know whether this will answer your question, because I don't see where that T would be coming from. And I'm not sure about this under (vl-cmdf) or in relation to (initcommandversion), but it's certainly true when using a (command) function that [for whatever inexplicable reason] under normal circumstances the Explode command can't Explode more than one object at a time. So you can't feed it a selection set, unless you play with the mysterious and undocumented QAFLAGS System Variable. Search for threads with Explode and QAFLAGS in them, and you'll find lots of examples of how to deal with it. Or you can step through a selection set, and Explode each thing in it individually, to avoid the QAFLAGS issue.
As an aside, you can simplify your selection-set filtering, by combining multiple entity type names in (wcmatch) fashion:
(if (setq DIM (ssget "x" '((0 . "DIMENSION,LEADER"))))
....