Run Script Skip Dialogue Box

Run Script Skip Dialogue Box

dalton98
Collaborator Collaborator
703 Views
5 Replies
Message 1 of 6

Run Script Skip Dialogue Box

dalton98
Collaborator
Collaborator

Sorry if this is an easy question, but I cant find an answer. I want to run a script using only the command box and not have the dialogue box pop up asking me which script to run.

I've tried..

 

-SCRIPT "scriptfile.scr"

-SCRIPT scriptfile.scr

/b scriptfile.scr

 

Thanks

0 Likes
Accepted solutions (1)
704 Views
5 Replies
Replies (5)
Message 2 of 6

pendean
Community Legend
Community Legend

Where and how are you running this script/macro?

Why add the .scr, does SCRIPT command run anything else that I may have missed?

Where are your SCR files stored?

 

We place all SCR files in a folder that is pathed in AutoCAD's search in OPTIONS, then code it simply like this as a button for users to click on if they want that choice

 

pendean_0-1647457312471.png

 

0 Likes
Message 3 of 6

dalton98
Collaborator
Collaborator

So I can store scripts in AutoCad like a template? I'm very new to this program so I don't quite know where to start.

 

The code is very simple and looks like this:

-LAYMRG
N
IV_INTERIOR_PROFILES

N
0
Y
-LAYDEL
N
IV_ARC_CENTERS

Y

0 Likes
Message 4 of 6

dalton98
Collaborator
Collaborator

The reason I ask is because I'd like to run 4-5 scripts like this one at a time. I could just copy and paste every code line for line but this seemed tedious

0 Likes
Message 5 of 6

Kent1Cooper
Consultant
Consultant
Accepted solution

Two suggestions:

 

1.  Set the FILEDIA System Variable to 0 first.

 

2.  Use an AutoLisp (command) function:

(command "_.script" "scriptfile")

Kent Cooper, AIA
0 Likes
Message 6 of 6

Sea-Haven
Mentor
Mentor

Are you saying make a layer then delete a layer but repeat may be easier with a lisp where you can have a list of layers and process all in one code,

(newlayer oldlayer)(newlayer oldlayer)(newlayer oldlayer)(newlayer oldlayer)

0 Likes