Script Help

Script Help

sssf_23
Enthusiast Enthusiast
518 Views
4 Replies
Message 1 of 5

Script Help

sssf_23
Enthusiast
Enthusiast

I created a script to delete a stamp by layer but not all of the script will do what I need it to do. I need help. I want to delete the stamp, zoom extents, purge all, save & close. The script works but for some reason the purge is not working properly. When I run it, it processes fine but when I re-open the drawing & try to re-insert the stamp, not all of the parts of the block come in. If I purge it manually it works but not with the script. This is what I have.

 

-laydel

n

stamp

 

y

 

 

z e

 

-purge

a

*

n

 

qsave

close 

 

Can someone help me to see why it is not working properly.  Thanks

0 Likes
Accepted solutions (1)
519 Views
4 Replies
Replies (4)
Message 2 of 5

rhesusminus
Mentor
Mentor
Accepted solution

Do purge multiple times in your script. 3-4 times.

 

The manual purge command can do recursive purging. That's probably why it works when you do it manually.


Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 3 of 5

sssf_23
Enthusiast
Enthusiast
I will try your suggestion & let you know how it goes. Thanks for the input. I appreciate it.
0 Likes
Message 4 of 5

sssf_23
Enthusiast
Enthusiast

Thank you. This worked perfectly. I actually only needed (2) purge commands with a double space at the end to qsave & close. I appreciate all your help. You are awesome. I Actually have more scripts that I need to write, just staring out. I haven't gotten to them yet. Baby steps, one script at a time. Thanks 😊 

0 Likes
Message 5 of 5

sssf_23
Enthusiast
Enthusiast

I am experiencing another issue now. When I copy & paste the script on the command line it works. But if I drag & drop the script it gives an error "unknown command "z". Press F1 for help. I am using the Script Pro 2.0 app. I ran 386 drawings & they all said done but when I went to check the actual drawing to see if it worked, there was nothing. I removed close from my Script only qsave at the end. It's like it is not reading the script properly. 😕 🤔

0 Likes