Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

explode last

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
GeryKnee
600 Views, 5 Replies

explode last

 

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

 

5 REPLIES 5
Message 2 of 6
hmsilva
in reply to: GeryKnee

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

EESignature

Message 3 of 6
GeryKnee
in reply to: hmsilva

 

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

 

 

Message 4 of 6
hmsilva
in reply to: GeryKnee

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

EESignature

Message 5 of 6
GeryKnee
in reply to: hmsilva

thanks Henrique

Regards,

Gery

Message 6 of 6
hmsilva
in reply to: GeryKnee

You're welcome, Gery
Glad I could help

Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost