How to stop a commands in a script file

How to stop a commands in a script file

Anonymous
Not applicable
1,409 Views
3 Replies
Message 1 of 4

How to stop a commands in a script file

Anonymous
Not applicable
Finally I managed to stop all the commands in script file: -INSERT "BLOCK A=C:\SCRIPTS\BLOCK B" 0,0,0 ERASE (SETQ en (ENTLAST)) QSAVE
0 Likes
Accepted solutions (2)
1,410 Views
3 Replies
Replies (3)
Message 2 of 4

john.vellek
Alumni
Alumni
Accepted solution

Hi @Anonymous,

 

You might also try using (SSGET "L") instead of the Entlast. Both should work however, I notice that you set a variable "en" to the last entity but don't do anything with it. If you are trying to erase "EN" you should define it before the erase command.

 

(setq EN (entlast))

Erase

!en

 

Thanks for your contribution.

 

Please select the Accept as Solution button if my post fully solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 3 of 4

ВeekeeCZ
Consultant
Consultant
Accepted solution

Try attached script (erase .txt). 

 

INSERT
"BLOCK A=C:\SCRIPTS\BLOCK B.dwg"
S
1
R
0
0,0
ERASE
l

QSAVE

 

Message 4 of 4

Anonymous
Not applicable
Actually I'm not trying to erase anything. I'm just trying to replace a block with another and not just one drawing but 3000. So I made a script and somehow it always stuck after replacing the block. It needed an "Esc" or a "Cancel". These terms are not known in scr, so I searched for something else. Then I found a lisp in which ERASE (SETQ en (ENTLAST)) was used. Adding this to my simple block replacing script did the trick for the batch job (BatchScript). Please modify and reply if you want. AI_SELALL REPTEXT PLC 1 PLC 3 AI_SELALL REPTEXT PLC 2 PLC 4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; INZOOMEN ZOOM E ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; IO BLOK VERVANGEN -INSERT "IO_BLOCK_1=C:\SCRIPTS\Scripts\IO_BLOCK_2" 0,0,0 ERASE (SETQ en (ENTLAST)) QSAVE
0 Likes