Message 1 of 11
Command-s use of EXPLODE not functioning
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've got a subroutine that for the most part does what I want it to do (unioning together the green layer and unioning together the blue layer), but then I want to explode each resulting entity into its original polylines rather than the region that results from the union command. The subroutine does all this for just a single grouping (not in the sense of the GROUP command), but when I select multiple groupings it doesn't explode.
(defun c:smartTrim ( / )
; get ss of containing offset layers, split into 1 ss for each layer
(setq ss (ssget '((8 . "PV Mech Equip Setback,PV Vents Skylights Roof Drains"))))
(setq ssMech (ssdel (ssname (ssget "_L") 0) (ssget "_L")))
(repeat (setq inc (sslength ss))
(setq ent (entget (ssname ss (setq inc (1- inc)))))
(if (equal (cdr (assoc '8 ent))
"PV Mech Equip Setback"
)
(progn
(setq eName (cdr (assoc '-1 ent)))
(ssadd eName ssMech)
(ssdel eName ss)
)
)
)
(setq ssMisc ss)
(setq ss nil)
; trimming PV VENTS SKYLIGHTS ROOF DRAINS
(command-s "_.-LAYER" "_SET" "PV Vents Skylights Roof Drains" "")
(setq ssMiscRegion (ssdel (ssname (ssget "_L") 0) (ssget "_L")))
(repeat (setq inc (sslength ssMisc))
(setq ent (entget (ssname ssMisc (setq inc (1- inc)))))
(setq eName (cdr (assoc -1 ent)))
(command-s "_.REGION" eName "")
(setq newEname (entlast))
(ssadd newEname ssMiscRegion)
(ssdel eName ssMisc)
)
(setq ssMisc nil)
(command-s "_.UNION" ssMiscRegion "")
(setq regionToExplode (entlast))
(command-s "_.EXPLODE" regionToExplode "") ;;; HERE - explode not working
; trimming PV MECH EQUIP SETBACK
(command-s "_.-LAYER" "_SET" "PV Mech Equip Setback" "")
(setq ssMechRegion (ssdel (ssname (ssget "_L") 0) (ssget "_L")))
(repeat (setq inc (sslength ssMech))
(setq ent (entget (ssname ssMech (setq inc (1- inc)))))
(setq eName (cdr (assoc -1 ent)))
(command-s "_.REGION" eName "")
(setq newEname (entlast))
(ssadd newEname ssMechRegion)
(ssdel eName ssMech)
)
(setq ssMech nil)
(command-s "_.UNION" ssMechRegion "")
(setq regionToExplode (entlast))
(command-s "_.EXPLODE" regionToExplode "") ;;; HERE - explode not working
; exit quietly
(princ)
)
Any suggestions?