@Anonymous wrote:
I have a selection set (SS1) and I want to wblock that selection set and name the block file a variable (PanelNumber) that was retrieved via lisp.
On the assumption that PanelNumber is an integer, and needs to be converted to text to make it the drawing name, try this:
(command
"_.wblock" (strcat "X:\\Your\\File\\Path\\" (itoa PanelNumber)) "" YourInsertionBasePoint SS1 ""
"_.oops"
)
If PanelNumber is a real number rather than an integer, use (rtos) instead of (itoa), and add mode and precision arguments. If it's already text, omit the (itoa) wrapper altogether.
That may vary somewhat by version. The first "" in there is to accept the <define new drawing> option in Acad2016 that I have here, but I don't think that's the way it has always worked.
Note that with the command-line version of WBLOCK, the objects are always removed from the drawing [not a choice as in the dialog-box version], hence the OOPS command to bring them back. Using "_.u" instead would also do it.
Kent Cooper, AIA