It's been a while since I've created a good scr, or worked in AutoCAD much at all.
I am creating a basic background cleanup scr for a coworker who is not familiar with CAD much at all. I have pathed the location of the script in tools > options > files tab > Support File Search Path. Guess I am missing a change at some point in CAD to where a dialog box pops up to further choose the scr I just commanded.
Can that not happen? Can I change a variable or something to where when I type the name of the scr it will just run as intended?
@Anonymous,
How are you calling your cleanup (how do you ultimately want this script to be called)?
- Are you calling a .lsp that would call your script?
- Are you running a script that you are hoping will call another script?
- Does the user press a button that you want to call this script?
I feel having more detail would help get you on the right track.
Best,
~DD
@CodeDing wrote:
@Anonymous,
How are you calling your cleanup (how do you ultimately want this script to be called)?
- Are you calling a .lsp that would call your script?
- Are you running a script that you are hoping will call another script?
- Does the user press a button that you want to call this script?
I feel having more detail would help get you on the right track.
Best,
~DD
Thank you for replying!
It's currently named CBK.scr (filename) and runs when I type CBK. However, when I run it, it pops up a dialog box to select it, then I select it again, and it does it's thing. When I type CBK it basically is acting like I typed SCR instead to pick the script. Hope that makes sense.
I created a toolbar and added a new command to a button. The macro currently has : ^C^C^P_cbk;
in it, and it executes the exact same way as if I typed SCR or CBK into the command line. I have tried the path as well, but it would then nil out.
In the script I have:
BASE
0,0,0
-XREF
D
*
NORM
ALL
BGMO
ALL
CBL
-LAYER
LW
0.0
*
-LAYER
ON
*
T
*
unlock
*
and then it goes on and on changing colors of layers. But it's not canceling out that dialog box to run the whole script.. it will if i select the scr file, but I don't want the user to have to do that.
@Anonymous,
Try this. It is what I use to run a script:
^C^C_script;test
"test" is the name of my script file -- test.scr
Best,
~DD
Suppose your CBK.SCR file is in the path "C:\Users\XXX\Desktop\CBK.SCR"..... Then try like this.....
^C^C^P_script;"C:/Users/XXX/Desktop/CBK.scr"
Or
^C^C_script;"C:/Users/XXX/Desktop/CBK.scr"
I wouldn't want to use that script on any of my drawings. A script shouldn't arbitrarily set all layers to 0.0 line weight or turn them all on without saving a layer state first. It shouldn't reset the basepoint without moving objects based on the current insbase location to the origin. It shouldn't detach xrefs if there is the remotest chance that the drawing will ever be edited again and should never detach xrefs that are attached vs overlaid.
I would look for problems in the custom commands such as norm, bgmo, and cbl.
Can't find what you're looking for? Ask the community or share your knowledge.