AutoCAD Electrical General Discussion

AutoCAD Electrical General Discussion

Reply
Active Contributor hw
Active Contributor
hw
Posts: 41
Registered: ‎06-17-2008
Message 1 of 9 (3,268 Views)

write a script file

3268 Views, 8 Replies
08-29-2008 06:40 AM
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
Active Contributor
purvy
Posts: 26
Registered: ‎02-08-2008
Message 2 of 9 (3,268 Views)

Re: write a script file

08-29-2008 07:23 AM 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
Valued Contributor
Elect74
Posts: 88
Registered: ‎09-27-2004
Message 3 of 9 (3,268 Views)

Re: write a script file

08-29-2008 08:38 AM 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.
Valued Contributor
Elect74
Posts: 88
Registered: ‎09-27-2004
Message 4 of 9 (3,268 Views)

Re: write a script file

08-29-2008 08:51 AM 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!
Active Contributor hw
Active Contributor
hw
Posts: 41
Registered: ‎06-17-2008
Message 5 of 9 (3,268 Views)

Re: write a script file

08-29-2008 10:39 AM in reply to: hw
awsome!
thank you very much
Valued Contributor
Masoome
Posts: 56
Registered: ‎08-30-2010
Message 6 of 9 (3,225 Views)

Re: write a script file

12-01-2010 12:30 AM 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

Member
streetglidewi
Posts: 4
Registered: ‎08-21-2012
Message 7 of 9 (2,549 Views)

Re: write a script file

08-21-2012 02:11 PM 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

Active Contributor
stefan.stamate
Posts: 48
Registered: ‎02-01-2012
Message 8 of 9 (2,526 Views)

Re: write a script file

08-22-2012 04:17 AM in reply to: streetglidewi

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...

Valued Contributor
rwydesk500
Posts: 59
Registered: ‎01-13-2010
Message 9 of 9 (2,493 Views)

Re: write a script file

08-24-2012 10:06 AM 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 2015
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions to get help installing your software.

New AutoCAD Electrical Category!

The AutoCAD Electrical forum has moved into it's very own category page, and can no longer be found within the Additional Product Forums.

Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.