Run a script from tool palette

Run a script from tool palette

Crass
Collaborator Collaborator
505 Views
4 Replies
Message 1 of 5

Run a script from tool palette

Crass
Collaborator
Collaborator

Hello I've create a simple script to clean consultant drawings and I wanted to create a button on a tool palette to run it. What am I doing wrong here? I assume there is some syntax error. Or is there a better way to do this? Thanks!

 

Crass_0-1746711495420.png

 

-----
AutoCAD 2018/2021
AutoCAD Civil 3D 2021
0 Likes
Accepted solutions (1)
506 Views
4 Replies
Replies (4)
Message 2 of 5

Moshe-A
Mentor
Mentor
Accepted solution

@Crass hi,

 

in menu macro terms '\' is treated as pause, replace each '\' with '/'

 

Moshe

Message 3 of 5

Sea-Haven
Mentor
Mentor

Have you thought about adding the file path to "support paths & trusted paths" then can just call the script by name, no need for directory path.

 

^c^cScript Cleanconsultantdwg

 

Note if you have spaces in the script name enclose with quotes "Clean consultant dwg" etc

Message 4 of 5

Crass
Collaborator
Collaborator

Doh! Thanks @Moshe-A. Appreciate it! Obviously a n00b error. I don't have a code / script-writing background so just trying to learn by doing it. Were there any references or tutorials you sounds helpful as you were getting started.

-----
AutoCAD 2018/2021
AutoCAD Civil 3D 2021
0 Likes
Message 5 of 5

Crass
Collaborator
Collaborator

Thanks @Sea-Haven this is a great idea. I will try it now.

-----
AutoCAD 2018/2021
AutoCAD Civil 3D 2021
0 Likes