(defun simplify
( chkBlk
/ ExplodeObject
convertSpline
convertSAT
objType a b isSAT)
(defun ExplodeObject
(object
/ N_ExplodeCommandModelSpace
N_ExplodeCommandOther
N_ExplodeMethod
modelSpaceObject ownerObject
)
(defun N_ExplodeCommandModelSpace
(object
) ; Use the explode command:
(command "_.explode" (vlax
-vla
-object
->ename object
)) )
;; The function uses the following variables from the main function:
;; activeDocument
;; 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:
)
(defun N_ExplodeMethod
(object
/ newObjectList
) ; Return the new objects in the block definition:
newObjectList
)
;;; object to ename
(N_ExplodeMethod object)
; Make sure that modelspace is current:
)
(if (= ownerObject modelSpaceObject
) (N_ExplodeCommandModelSpace object)
(N_ExplodeCommandOther object)
)
)
)
)
)
;;;
(defun convertSpline
(object
/ N_PEDITCommandModelSpace
N_PEDITCommandOther
modelSpaceObject ownerObject
)
(defun N_PEDITCommandModelSpace
(object
/ lastEname
) ; Use the PEDIT command:
(command "_.PEDIT" (vlax
-vla
-object
->ename object
) "" "") ; Get the enames of all new objects in modelspace:
)
(defun N_PEDITCommandOther
(object
/ lastEname newEnameList newObjectList tempObject
) ;; The function uses the following variables from the main function:
;; activeDocument
;; modelSpaceObject
;; ownerObject
; 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 PEDIT command:
(command "_.PEDIT" (vlax
-vla
-object
->ename object
) "" "") ; 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:
)
; Make sure that modelspace is current:
)
(if (= ownerObject modelSpaceObject
) (N_PEDITCommandModelSpace object)
(N_PEDITCommandOther object)
)
)
;;;
/ N_ConvertModelSpace
N_ConvertOther
modelSpaceObject ownerObject clipForm
)
(defun N_ConvertModelSpace
(en
) ; Use the ctrl-c-ctrl-p command:
(command "._COPYBASE" '
(0.0 0.0 0.0) en
"") (command "._PASTECLIP" '
(0.0 0.0 0.0)) )
(defun N_ConvertOther
(object
/ lastEname newEnameList newObjectList tempObject
) ;; The function uses the following variables from the main function:
;; activeDocument
;; modelSpaceObject
;; ownerObject
; 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 ctrl-c-ctrl-p command:
; 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:
)
; Make sure that modelspace is current:
;;; save iriginal clipboard format and set it to 22
)
(if (= ownerObject modelSpaceObject
) (N_ConvertModelSpace en)
)
;;; restore clopboard format
(setvar "ClipBoardFormat" clipForm
) )
;;;
(foreach a
(Blk_ENameLstNstd chkBlk
) (if (= objType
"AcDbModelerGeometry") (setq isSAT
1)) ))
)
)
)
))
)
)