where is the error in code :::
(defun c:PasteBlockX ()
(command "_pasteblock" (getvar "viewctr"))
(entdel (entlast))
(princ)
(command "-insert" "" "_rotate" 0)
(princ)
(command "explode" "last" "")
(princ)
(princ)
)
ommand "explode" does not explode last inserted block
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
You'll need to supply a valid point to the INSERT command...
(command "_pasteblock" (getvar "viewctr")) (entdel (entlast)) (command "-insert" "" (getvar "viewctr") "" "" "") (command "explode" "last") (princ)
HTH
Henrique
hello Henrique
I need a code to paste clipboard drawing data , with user specification of insertion point and opposite corner
code
(defun c:PasteBlockX ()
(command "_pasteblock" (getvar "viewctr"))
(entdel (entlast))
(princ)
(command "-insert" "" "_rotate" 0)
(princ)
(princ)
works perfectly :::
after copying drawing to clipboard :
Command: _PasteBlockX _pasteblock Specify insertion point:
Command: -insert Enter block name or [?] <A$C6CEC1C74>: Specify insertion point
or [Basepoint/Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]: _rotate Specify
rotation angle: 0 Specify insertion point or
[Basepoint/Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]:
Specify insertion point or
[Basepoint/Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]:
Enter X scale factor, specify opposite corner, or [Corner/XYZ] <1>:
Command:
After the end of code execution , there has been created a block (the A$C6CEC1C74 block) that i want to be exploded immediatelly.
Thanks,
Gery
Gery,
if it works for you, perhaps something like this
(defun c:PasteBlockX () (command "_pasteblock" (getvar "viewctr")) (entdel (entlast)) (command "-insert" "" "_rotate" 0) (while (> (getvar 'cmdactive) 0) (command pause) );; while (command "explode" "last") (princ) )
HTH
Henrique