AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

write a script file

8 REPLIES 8
Reply
Message 1 of 9
hw
12370 Views, 8 Replies

write a script file

Ho there,
can anybody post a link or other reading material about how to write a script file.

for example how to hide WIRENO layer.

i know nothing about it, so anything would be helpful

thanks
8 REPLIES 8
Message 2 of 9
purvy
in reply to: hw

Hi,

I don't know where you could find reading materials about how to write a script files.

If you want to hide WIRENO layer project wide, create file with Notepad, write there:

(command "_.LAYER" "_SET" "0" "_FREEZE" "WIRENO" "")

.. and change the file name for example hidewireno.scr

Then use Project-Wire Utilities command. Pick Run command script file function, then browse for script file and press OK button. Then pick Project and select drawing to process. That's it.

Sometimes it's usefull to use the search system of this discussion. (:

purvy

Message was edited by: purvy null
Message 3 of 9
Anonymous
in reply to: hw

Writing script files can be very easy. They are just a list of commands executed sequentially. Just follow these steps:

1. Manually run through the process by typing commands at the command line.
2. Carefully document (write down) every keystroke you enter including returns.
3. In Notepad (or any other ASCII editor) type in the commands you entered including the returns.
4. Save the file with a .scr extension.
5. In AutoCAD, at the command line, enter SCRIPT. Press Enter.
6. Browse to the script file you created.

The command sequence should run as written.

For example to hide the WIRENO layer, use the following script:

-layer
off
wireno


Explanation:
-layer - The dash in front of the layer tells AutoCAD to use the command line version instead of the dialog box. You cannot enter dialog box options in a script file.

off - This is the command line option to turn off or hide a layer.

WIRENO - This is the layer name you want to hide. You can enter multiple names by separating them with a comma.

- Just like at the command line, be sure to add an extra return in the script file. This will appear as a blank line but is essential to complete the command.

The key to creating script files is to complete the command sequence at the command line (and documenting it) before trying to create the script file. Once it works at the command line, it is easy to create a script file.
Message 4 of 9
Anonymous
in reply to: hw

Then to execute your script file project wide, go to Project-Wide Utilities. Under For Each Drawing, select Run Command Script File. Browse to the script file you created. Click OK.

It should work like magic!
Message 5 of 9
hw
in reply to: hw

awsome!
thank you very much
Message 6 of 9
Masoome
in reply to: hw

Hi,

I had exactly the same problem in writing script file for turning the Wire No layer off. Thanks for your comprehensive guidance.

 

Regards,

Masoome

Message 7 of 9
streetglidewi
in reply to: hw

I too am looking to write a script to be able to change the CAT attribute to a different height and width. It is not one of the options in the project wide utility. Thanks in advance for any help

Message 8 of 9

The script might not work considering that the "Change attribute size" command (AEATTSIZE) calls a window. Alternatively you can modify the blocks and swap them project wide or use the "Change Attribute Size" command on each drawing and select "By name" to change all the atributes with the same name (in your case CAT).

See also the comments in this entry: http://forums.autodesk.com/t5/AutoCAD-Electrical/changing-text-size-not-found-in-project-wide-utilit...

Message 9 of 9
rwydesk500
in reply to: hw

Cadalyst online Magazine has an article dated Dec. 1, 1998, on this.

 

More recently on Cadalyst see this.

 

Bill Fane is good at explaining the skill. I once emailed him and his response is in the attached Notepad document. Work your way through the step by step process and you will probably be able to figure it out.

Regards,

Rick Yoerger

AutoCAD Electrical 2016

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost