Originally Posted by
ahefner
Wow, the weird limitations you come across just trying to automate the simplest of tasks.
Help would be great.
Here's the idea... I have some xrefs which the architect has added POLYLINEs with a thickness to represent the bathroom stalls and hand rails. I simply need to explode the PLINEs so they loose their thickness and are controlled "bylayer". My button macro reads as follows:
Code:
^C^CZOOM;e;EXPLODE;(ssget "_X" '((0 . "LWPOLYLINE,POLYLINE")));
Is there a somewhat simple way to adapt what that link was talking about (btw, thanks for the link) to accomplish the task described above?
I need to do a little research on tilemode, ctab, and how to handle going through a viewport, (maybe someone will jump in here and help with that. Please!) but this is a quick and dirty start:
Code:
(defun c:explodeplines ( / ss cnt)
(setq ss (ssget "X" (list (cons 0 "LWPOLYLINE,POLYLINE");select all polylines
(cons 410 (getvar "ctab")) ;in current tab
)
)
)
(repeat (setq cnt (sslength ss))
(command "explode" (ssname ss (setq cnt (1- cnt))))
)
(princ)
)
At least it works for model space and doesn't do the other tabs if you are in model space.
Just in case; I don't know how experienced you are: Copy the code to a text file with a .lsp extension and save it somewhere in your support directories. Then type (load "whateveryoucalledit") at the command line. If you need help automating that, let us know. You might want to have a look at RK's blog for some tips on setting up customizations, also.
Once loaded, the macro could be
Code:
^C^CZOOM;e;explodeplines;
HTH