(defun simplify
( chkBlk
/ objType a b ret test
) (foreach a
(Blk_ENameLstNstd chkBlk
) )
)
))
)
)
(defun ExplodeObject
(object
/ N_ExplodeCommandModelSpace
N_ExplodeCommandOther
N_ExplodeMethod
correctPosition
modelSpaceObject ownerObject
)
(defun correctPosition
(object
/ lastEname newEnameList newObjectList tempObject
) )
activeDocument
'copyobjects
modelSpaceObject
)
)
)
(setq newEnameList
(cons lastEname newEnameList
)) )
activeDocument
'copyobjects
ownerObject
)
)
)
)
(defun N_ExplodeCommandModelSpace
(object
/ lastEname newEnameList
) ; Store the ename of the last object in modelspace:
; Required for 'SEQEND situations':
)
; Use the explode command:
(command "_.explode" (vlax
-vla
-object
->ename object
)) ; Get the enames of all new objects in modelspace:
(setq newEnameList
(cons lastEname newEnameList
)) )
)
;; The function uses the following variables from the main function:
;; docObject
;; modelSpaceObject
;; ownerObject
(defun N_ExplodeCommandOther
(object
/ lastEname newEnameList newObjectList tempObject
) ; Store the ename of the last object in modelspace:
; Required for 'SEQEND situations':
)
; Make a temporary copy of the object from the block definition in modelspace:
activeDocument
'copyobjects
modelSpaceObject
)
)
)
; Delete the object from the block definition:
; Use the explode command:
(command "_.explode" (vlax
-vla
-object
->ename tempObject
)) ; Get the enames of all new objects in modelspace:
(setq newEnameList
(cons lastEname newEnameList
)) )
; Copy the new objects to the block definition:
activeDocument
'copyobjects
ownerObject
)
)
)
; Delete the new entities from modelspace:
; Return the new objects in the block definition:
newObjectList
)
(defun N_ExplodeMethod
(object
/ newObjectList
) ; Return the new objects in the block definition:
newObjectList
)
(N_ExplodeMethod object)
; Make sure that modelspace is current:
)
(if (= ownerObject modelSpaceObject
) (N_ExplodeCommandModelSpace object)
)
)
(N_ExplodeCommandOther object)
(correctPosition object)
)
)
)
)
)
)
;;;
safeObjects "ACDBXLINE,ACDBVIEWPORT,ACDBVERTEX,ACDBTRACE,ACDBFCF,ACDBTEXT,ACDBSHAPE,ACDBRAY,ACDBPOINT,ACDBPOLYFACEMESH,ACDBOLE2FRAME,ACDBOLEFRAME,ACDBLINE,ACDBBLOCKREFERENCE,ACDBRASTERIMAGE,ACDBELLIPSE,ACDBCIRCLE,ACDBARC,ACDBFACE,ACDBATTRIBUTE,ACDBSPLINE,ACDBHATCH"
)
(= T(contentCheck(Blk_ENameLstNstd blkN)))
)
(simplify blkN)
)
)
)