Although each release of AutoCAD translates to bigger and arguably better features one thing has never changed; its malleability. In fact some would argue the malleability of the software as being its best feature. Be it the CUI command, LISP routines, or even VBA and .NET applications. Each of these features is included in the software for one reason – user customization. Even still, LISP and .NET customization can be rather illusive for all but a small minority of the AutoCAD user base.
An Easy Path to Customization
Luckily script customization affords even rookie AutoCAD users a way to automate AutoCAD with endless possibility. While I know the sheer term “Script File” intimidates many, but truth be known, you’ve been writing script files for as long as you have been using AutoCAD. So how is that possible? Well, an AutoCAD script file is really nothing more than a sequence of standard AutoCAD Commands. Thus if you know how to type commands at the command line, you know how to write a script file.
Scripting Commands with Dialog Boxes
Let’s take a look at how we might create a script file which creates a new layer named C-ROAD-TEXT, sets its color to Yellow, and then sets the layer current.
The LAYER command is among a growing number of AutoCAD Commands which have both a dialog box version and a command line version. By default, AutoCAD uses the dialog box version of a command. While this is great for general usage, script files have no way to interact with dialog boxes. For this reason, we must explicitly tell AutoCAD to use the command line version of a command. Generally, this can be done by prefixing the command name with a hyphen (-). Consequently, rather than typing LAYER which opens the Layer Manager Dialog, we will need to type -LAYER. This will suppress the dialog, and present the entire command at the command line.
Using the Command Line Version of a Command
Typing -LAYER at the command line results in the following prompt:
Enter an option [?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck/Unlock
/stAte]:
Admittedly, navigating the command line version of a command can certainly add a degree of intimidation to this whole process. The important thing to pay attention to here is which letter(s) are capitalized. Looking at the -LAYER command, typing “C” will allow you to set a color, but assigning a material means three characters; MAT. In looking at the command prompt, you’ll notice that Color is represented with just the C capitalized, whereas MATerial has MAT capitalized. Using these abbreviations will share you a few keystrokes, but when in doubt you can always spell out the entire option. Thus rather than typing C, you could type Color in its entirety.
Looking once again at the command prompt, I want to create a layer named C-ROAD-TEXT. The option to create a new layer is New, and so I’ll simply enter N at the command line.
Enter an option [?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck/Unlock
/stAte]: N
After specifying the New option, AutoCAD will now prompt me with the following where I will enter my desired layer name. In this case, I’m going to enter C-ROAD-TEXT.
Enter name list for new layer(s): C-ROAD-TEXT
Upon pressing enter I am returned to the base LAYER command, where I can now change the color of my C-ROAD-TEXT layer from the default, White, to Yellow. To do that I’ll enter C, which we now know stands for Color.
Enter an option [?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck/Unlock
/stAte]: C
Assuming I use one of the standard 255 AutoCAD colors, I can simply enter the desired number. As some may know, for primary colors such as Red, Yellow, Blue, even Cyan, I can either enter the colors number or it’s name.
New color [Truecolor/COlorbook] : Yellow
After specifying my desired color, I must now tell AutoCAD which layer to make yellow. I will of course enter C-ROAD-TEXT at this point.
Enter name list of layer(s) for color 2 (yellow) <0>: C-ROAD-TEXT
Building a Script from a Command Sequence
At this point, I have now assigned the color Yellow to my newly created C-ROAD-TEXT layer. With that, I can simply <Enter> through the command. So what does all of this look like in the form of a script?
Script | Description |
-LAYER | Command Line Version of the LAYER command |
N | Shortcut for New |
C-ROAD-TEXT | My new Layer Name |
C | Shortcut for Color |
Yellow | Could also enter 2 for Yellow |
C-ROAD-TEXT | Layer I want to assign the color Yellow to. |
Blank line representing an <Enter> | |
Blank line representing an <Enter> |
AutoCAD knows to execute this as a script file based on its extension. For this reason, I’ll want to use my favorite text editor (Notepad), do a File > Save As, and be sure to use a .SCR extension.
Naturally, creating the script file is but half the battle. I now need to execute the file in some way. Being a keyboard commando, you can execute a script file by typing SCRIPT or SCR at the command line. The other option is to go to Tools > Run Script. Both options will launch a dialog where I can then browse to the location of my .SCR file.
The most fundamental way of launching a script file is by typing SCRIPT or SCR at the command line. This will launch a dialog, where I can then browse to wherever I have saved my .SCR file.
[…] Introduction to AutoCAD Script Files – The CAD Geek […]
I’m trying to create a family of scripts (planning to do it in Excel) to batch-generate a large number of similar drawings with different dimensions. My stumbling block is the HATCH command. How do I ‘terminate’ a HATCH command from inside a script ?
After selecting the objects to hatch & defining the pattern, AutoCAD remains waiting for an “empty ENTER” & returns control to the keyboard. Pressing ENTER from the keyboard gives the correct result, but subsequent commands in the script don’t work … and I need to do more, so can’t make it the last. Please suggest.
Maybe I should move to AutoLisp, make a program that reads a CSV dump from the Excel file ?
Using AutoCAD 2009
A dialog is still popping up using the commands -FIND and -QSELECT. Do not all commands have a command prompt version? If so, is there a way to tell which ones do and don’t?
Hy, I have problem, my script is sometimes runing but sometimes it isn`t. For example I write many lines to plot one after one, but in one place it stops and doesn`t plot next lines. Well, I once more cheked script and all looks ok. Then I try to open it in AutoCad once more and it works, sometimes partly, sometimes full, but where is the problem? I am working on AutoCad LT 2013, and writing scripts in Notpad.
Thanks!
You may be having an extra space somewhere at the end of a line.
Hey donnie,
Thanks a lot for helping us out with these scripts. I have been trying to write a script file that would turn certain layers on and off for a entire project. Can you if possible write a s mall blog about how to do this?
Thanks!!
how can i make script file
what about dealing with colorbook colors?
indeed helpful
Hi..i have written a script to convert dwg to pdf. I am running it through batch file. If i run batch file through windows command prompt it is converting drawings correctly but if i run batch file through jsp Autocad opens and C:/Windows/System32/Drawing.dwg gets opened.How to run it through jsp..thanks in advance
Anyone can always use Hurricane Batch Script Generator for AutoCAD. It has a nice user interface that can simplify and store your scripts, has reusable tags (so you can make generic scripts) for different projects, and even batch update Title Blocks with variable data… take a look http://www.74mph.com
Donnie,
I am trying to repath XREFERENCES from a script file. We work with a template file and a database of projects. The template files get copied into the job directories and then renamed based on the project name in the database. We have an IT guy handling that end of it, but i get to handle the AUTOCAD end of it and the script file generation. I am looking to write 1 generic script file that will handle all the xreferences we have in all our files. However, not every file has every reference. And that is my problem. the first time autocad runs the script and runs into a reference that might not be attached to a paticular file (elevation reference in a plan drawing) it bombs out and quits. Is there anyway for me to get it to ignore the xref that isnt required and just move to the next line of the script?…
As -layer takes you to layer command, what other entries are there for use? For example, if you have change the view to SE Isometric at the end of the sequence how would you proceed?
Either by using a script processor or creating a simple batch file for your directory, such as (md d:cleanedfilesDWGwb
FOR %%f in (<directory path>*.dwg) do start /wait c:”Program Files””Autodesk””AutoCAD MEP 2011″acad.exe “%%f” /b <directory path><script file>
Hello,
I am having some problem with a script file that was created using Microsoft office 2003. I have microsoft office 2007. My autoCAD is 2006. I don't know much about script files. I was wondering if this is some compatibility problem- office 2007 can't open 2003 files?
Thank You
There is no compatibility issues within Office 2007 & 2003. Use notepad to create your script files.
Hello,
I am creating standard layers and would like to use a Script to load them to the drawing.
I have the script working with the exception of the Description, the script does not know when my description text is finished. i.e.
-layer make E-ANNO-TEXT color 2 E-ANNO-TEXT ltype Continuous E-ANNO-TEXT lweight default E-ANNO-TEXT plot plot E-ANNO-TEXT description regular anotation text E-ANNO-TEXT
I want the Description to end at "……anotation text" yet it looks at the layer name as part of the description.
thanks
Hello,
I am creating standard layers and would like to use a Script to load them to the drawing.
I have the script working with the exception of the Description, the script does not know when my description text is finished. i.e.
-layer make E-ANNO-TEXT color 2 E-ANNO-TEXT ltype Continuous E-ANNO-TEXT lweight default E-ANNO-TEXT plot plot E-ANNO-TEXT description regular anotation text E-ANNO-TEXT
I want the Description to end at "……anotation text" yet it looks at the layer name as part of the description.
thanks
Donnie,
How do we make a comment in a script file that will show on the Command Line after the script has run? Such as "B Plot sent".
Thank you,
Mike
Donnie,
How do we make a comment in a script file that will show on the Command Line after the script has run? Such as "B Plot sent".
Thank you,
Mike
That is pretty well what I ended up doing Donnie. I created a new text style and set it to bold and then changed the table properties to use that text style.
Thanx again for the reply and advise :)
Les
That is pretty well what I ended up doing Donnie. I created a new text style and set it to bold and then changed the table properties to use that text style.
Thanx again for the reply and advise :)
Les
Hi Donnie
I would like to update my attributes in a drawing. The blocks name is xx and my datas are in a textfile on the harddisk, i.e. atribs.txt Is this by means of a script possible?
Thanks for your help
vittorio
vittorio – I haven’t done it using a script before, but in theory it’s possible using the ATTIN/ATTOUT commands. I’ve got a blog post on using the commands which can be found: https://thecadgeek.mystagingwebsite.com/blog/2008/03/12/update-block-attributes-using-excel/
Hi Donnie
I would like to update my attributes in a drawing. The blocks name is xx and my datas are in a textfile on the harddisk, i.e. atribs.txt Is this by means of a script possible?
Thanks for your help
vittorio
vittorio – I haven’t done it using a script before, but in theory it’s possible using the ATTIN/ATTOUT commands. I’ve got a blog post on using the commands which can be found: https://thecadgeek.mystagingwebsite.com/blog/2008/03/12/update-block-attributes-using-excel/
Hi Donnie,
Appreciate your blog and your time!
All I want to do is change the height of the text and Line Space Factor. I Right click, go to Properties, in the Properties Dialog Box, I change the Value of Text Height to .065 (frm .074) and Line Space Factor to .85 (frm 1.00).
I’ve tried with scripts, but unsucessful so far. Can u please help me out? I use Autocad 2002 and it’s not always the same files. An help is appreciated.
Suresh – Going from memory here, but have you tried the CHANGE and or CHPROP command? I’m not 100% sure, but one of them might give you what you need. Those are the two commands I’d try first, and if they don’t give you what you need, perhaps look for some LISP code to do what you need.
Hi Donnie,
Appreciate your blog and your time!
All I want to do is change the height of the text and Line Space Factor. I Right click, go to Properties, in the Properties Dialog Box, I change the Value of Text Height to .065 (frm .074) and Line Space Factor to .85 (frm 1.00).
I’ve tried with scripts, but unsucessful so far. Can u please help me out? I use Autocad 2002 and it’s not always the same files. An help is appreciated.
Suresh – Going from memory here, but have you tried the CHANGE and or CHPROP command? I’m not 100% sure, but one of them might give you what you need. Those are the two commands I’d try first, and if they don’t give you what you need, perhaps look for some LISP code to do what you need.
Donnie,
I’ve been playing with script files using the tabledit command. I can populate cells of the AutoCAD table, but I am trying to figure out how to issue a command to make the text bold.
At a command line in Autocad, the typing of CTRL+B sets the bold off and on…but how can that be written in script?
Thanx
Les – I’m not sure how to issue a Ctrl + B via script. Something you may look into is using a “Bold” text style, assigning it to the text rather than trying to issue a Ctrl + B command through script.
Donnie,
I’ve been playing with script files using the tabledit command. I can populate cells of the AutoCAD table, but I am trying to figure out how to issue a command to make the text bold.
At a command line in Autocad, the typing of CTRL+B sets the bold off and on…but how can that be written in script?
Thanx
Les – I’m not sure how to issue a Ctrl + B via script. Something you may look into is using a “Bold” text style, assigning it to the text rather than trying to issue a Ctrl + B command through script.
Hello,
First of all, thank you for your wonderful blog and the tips (and time) you put in it.
I have a little question to which I haven’t been able to find the answer, and I’d like to know if you could help me.
The thing is that I want to execute some lisp script in hundreds of drawings, but in order to save some time I’d like to completely avoid AutoCAD from actually “drawing” the file o the screen.
I’ve taken a look to ScriptPro but it doesn’t seem to have this feature.
Have you had any experience alike? or known of some way to do it?
So far I’ve tried putting this into the script:
(setvar “layoutregenctl” 2)
(setvar “regenmode” 0)
But it still gets drawed when opening the file (off course changing to and from model space afterwards is much faster).
Thanks in advance for *any* answer you may have (even if it is a simple “I don’t really know”).
Cheers.
@Andrés – I think the underlying problem is with the batch processor, not your script. Your batch processor (ScriptPro) is what opens your drawing (not the script file itself). For this reason, I suspect your DWG is being REGENed (drawn) before your script has a chance to run. Consequently I really don’t know of a way to get around this behavior.
I’m not sure if ScriptPro (or perhaps another batch processor) has the ability to “Partial Open” a drawing. Partial Open is an option from the AutoCAD open dialog, and doesn’t make AutoCAD load as much of your drawing.
Hello,
First of all, thank you for your wonderful blog and the tips (and time) you put in it.
I have a little question to which I haven’t been able to find the answer, and I’d like to know if you could help me.
The thing is that I want to execute some lisp script in hundreds of drawings, but in order to save some time I’d like to completely avoid AutoCAD from actually “drawing” the file o the screen.
I’ve taken a look to ScriptPro but it doesn’t seem to have this feature.
Have you had any experience alike? or known of some way to do it?
So far I’ve tried putting this into the script:
(setvar “layoutregenctl” 2)
(setvar “regenmode” 0)
But it still gets drawed when opening the file (off course changing to and from model space afterwards is much faster).
Thanks in advance for *any* answer you may have (even if it is a simple “I don’t really know”).
Cheers.
@Andrés – I think the underlying problem is with the batch processor, not your script. Your batch processor (ScriptPro) is what opens your drawing (not the script file itself). For this reason, I suspect your DWG is being REGENed (drawn) before your script has a chance to run. Consequently I really don’t know of a way to get around this behavior.
I’m not sure if ScriptPro (or perhaps another batch processor) has the ability to “Partial Open” a drawing. Partial Open is an option from the AutoCAD open dialog, and doesn’t make AutoCAD load as much of your drawing.
Once you have a script written, how can you have it automatically invoked from the command line? I want to have a program open an AutoCAD drawing, run the specified script(s), and then close the drawing.
Can this be easily done in VBA?
@Tom – If all you want to do is open a drawing, run a script, and then close the drawing, a free utility from Autodesk named ScriptPro is probably your ticket. It does just that, lets you run a script to a batch of DWG’s. Just be sure to add a save command at the end of your script.
ScriptPro: http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=4091678&linkID=9240618
If you really want something available at the command line. I’d probably encase it in a simple LISP. Maybe something like:
(defun c:myscript ()
(command ) Insert list of commands into a command parameter
)
Once you have a script written, how can you have it automatically invoked from the command line? I want to have a program open an AutoCAD drawing, run the specified script(s), and then close the drawing.
Can this be easily done in VBA?
@Tom – If all you want to do is open a drawing, run a script, and then close the drawing, a free utility from Autodesk named ScriptPro is probably your ticket. It does just that, lets you run a script to a batch of DWG’s. Just be sure to add a save command at the end of your script.
ScriptPro: http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=4091678&linkID=9240618
If you really want something available at the command line. I’d probably encase it in a simple LISP. Maybe something like:
(defun c:myscript ()
(command ) Insert list of commands into a command parameter
)
hey Donnie
i have a problem ending the polyline command in the script please help me in that
hey Donnie
i have a problem ending the polyline command in the script please help me in that
Thanks Donnie I will look into that batch program.
HI
THIZ IS JAWAD CAN U HELP ME ON SCRIPTS HOW TO MAKE IT
JWAD – A script file is nothing but a TXT file saved with a SCR extension. So rather than saving it as script.txt, you would save it as script.scr. As discussed above, each line of your text file will correspond to a ling (enter) on the AutoCAD command line. Whatever you would enter at the command line, is the same thing you would enter inside your text (SCR) file.See the table above for an example of this. My SCR fill would only contain the left column.
Thanks Donnie I will look into that batch program.
HI
THIZ IS JAWAD CAN U HELP ME ON SCRIPTS HOW TO MAKE IT
JWAD – A script file is nothing but a TXT file saved with a SCR extension. So rather than saving it as script.txt, you would save it as script.scr. As discussed above, each line of your text file will correspond to a ling (enter) on the AutoCAD command line. Whatever you would enter at the command line, is the same thing you would enter inside your text (SCR) file.See the table above for an example of this. My SCR fill would only contain the left column.
@ajay – AutoCAD is going to draw things on your current layer. Use the -LAYER command to set the respective layer current.
@ Richard – Take a look at the TCOUNT command. It’s an Express tool that does as it’s name implies, counts at a specified increment.
@ Steve – I’d venture to say what you’re trying to do cannot be accomplishes with straight script. You may have some luck with LISP, VBA, or .NET. Each of those are however much more complex than straight script.
@ Eric – The batch processor was originally written for AutoCAD 2007. I did not personally write that program, so it’s hard to say what may be going on with the script. Since writing this article I have however found a batch script program released by Autodesk called ScriptPro. You can download it from the following address: http://images.autodesk.com/adsk/files/scriptpro.exe
@ajay – AutoCAD is going to draw things on your current layer. Use the -LAYER command to set the respective layer current.
@ Richard – Take a look at the TCOUNT command. It’s an Express tool that does as it’s name implies, counts at a specified increment.
@ Steve – I’d venture to say what you’re trying to do cannot be accomplishes with straight script. You may have some luck with LISP, VBA, or .NET. Each of those are however much more complex than straight script.
@ Eric – The batch processor was originally written for AutoCAD 2007. I did not personally write that program, so it’s hard to say what may be going on with the script. Since writing this article I have however found a batch script program released by Autodesk called ScriptPro. You can download it from the following address: http://images.autodesk.com/adsk/files/scriptpro.exe
I’m trying to use the Batch Processor you told someone else about and I’m getting a error when I test it on 6 drawings. Time is an issue and it will not run. I think it work the first time but not any longer. I will be happy to send a copy of the error code if I have an email to send it to. Thanks.
I’m trying to use the Batch Processor you told someone else about and I’m getting a error when I test it on 6 drawings. Time is an issue and it will not run. I think it work the first time but not any longer. I will be happy to send a copy of the error code if I have an email to send it to. Thanks.
We have been using scripts for a few years now but have decided to adjust our drawings sheets. We use a system of models xref’d into title panels to allow stacking of models. We are trying to write a scipt or macro where a new title sheet is opened in paper space from a central template directory and inserts an xref of the project title from a project directory. When the script runs as soon as you have chosen the new .dwt is selected the script stops as you are in a new session, the same happens with macros. Is there anyway to run scripts across the 2 sessions.
Many thanks.
We have been using scripts for a few years now but have decided to adjust our drawings sheets. We use a system of models xref’d into title panels to allow stacking of models. We are trying to write a scipt or macro where a new title sheet is opened in paper space from a central template directory and inserts an xref of the project title from a project directory. When the script runs as soon as you have chosen the new .dwt is selected the script stops as you are in a new session, the same happens with macros. Is there anyway to run scripts across the 2 sessions.
Many thanks.
I WOULD LIKE TO WRITE A SCRIPT IN WHICH I SELECT EITHER TEXT OR A LAYER CONTAINING TEXT AND BE ABLE TO INCREMENT THE TEXT BY 1. IN OTHER WORDS I AM DOING A PARKING LOT AND HAVE SET IT ALL OUT BUT NOW I HAVE TO INCREMENT EACH PARKING BAY BY ONE EG PARKING BAY 1 BECOMES 2 AND 2 BECOMES THREE AND SO ON …. DO YOU HAVE ANY IDEAS HOW I WOULD GO ABOUT THIS?
MANY THANKS
I WOULD LIKE TO WRITE A SCRIPT IN WHICH I SELECT EITHER TEXT OR A LAYER CONTAINING TEXT AND BE ABLE TO INCREMENT THE TEXT BY 1. IN OTHER WORDS I AM DOING A PARKING LOT AND HAVE SET IT ALL OUT BUT NOW I HAVE TO INCREMENT EACH PARKING BAY BY ONE EG PARKING BAY 1 BECOMES 2 AND 2 BECOMES THREE AND SO ON …. DO YOU HAVE ANY IDEAS HOW I WOULD GO ABOUT THIS?
MANY THANKS
hello sir,
i am not getting hot to change color of any drawing.
i am sending u my script file.
please tell me how to give different color to all cirlce..
circle 100,60 125.06
circle 100,60 72.42
circle 100,60 130.18
circle 100,60 69.85
circle 100,94.93 5.75
circle 130,77 5.75
circle 130,44 5.75
circle 100,26 5.75
circle 70,44 5.75
circle 68,75 5.75
circle 100,60 25
circle 100,165 3.5
circle 100,-30 3.5
circle 136,60 4.8
circle 64,60 4.8
end
hello sir,
i am not getting hot to change color of any drawing.
i am sending u my script file.
please tell me how to give different color to all cirlce..
circle 100,60 125.06
circle 100,60 72.42
circle 100,60 130.18
circle 100,60 69.85
circle 100,94.93 5.75
circle 130,77 5.75
circle 130,44 5.75
circle 100,26 5.75
circle 70,44 5.75
circle 68,75 5.75
circle 100,60 25
circle 100,165 3.5
circle 100,-30 3.5
circle 136,60 4.8
circle 64,60 4.8
end
@Steve – What about using the PUBLISH command to create a milti-sheet DWF file? If things MUST be in PDF, you can then print your DWF to PDF (which not only keeps the vector information, but generally shrinks the size of the PDF).
@Steve – What about using the PUBLISH command to create a milti-sheet DWF file? If things MUST be in PDF, you can then print your DWF to PDF (which not only keeps the vector information, but generally shrinks the size of the PDF).
Is there a way to plot a layered drawing to a single pdf file. I have created a script that works great when printing directly to a printer (each layer opens, prints, closes and next one opens etc. until it gets to the last layer), but when using Adobe Acrobat the first layer prints, it doesnt close and the next layer opens as well then everything just stops. Any help would greatlt be appreciated.
Is there a way to plot a layered drawing to a single pdf file. I have created a script that works great when printing directly to a printer (each layer opens, prints, closes and next one opens etc. until it gets to the last layer), but when using Adobe Acrobat the first layer prints, it doesnt close and the next layer opens as well then everything just stops. Any help would greatlt be appreciated.
@Ed – I haven’t tried scripting the process, but another one of my posts may be able to help you out (https://thecadgeek.mystagingwebsite.com/blog/2008/03/12/update-block-attributes-using-excel/)
Admittedly it’s not incredibly glamorous, but it does work. I used to use the method to manage my titleblock text before the days of Sheet Set Manager.
@Ed – I haven’t tried scripting the process, but another one of my posts may be able to help you out (https://thecadgeek.mystagingwebsite.com/blog/2008/03/12/update-block-attributes-using-excel/)
Admittedly it’s not incredibly glamorous, but it does work. I used to use the method to manage my titleblock text before the days of Sheet Set Manager.
Is there any way to create script file to change attribute in title block in Paper Space.
When I created script file started with command -ATTEDIT, seams every going well untill when required to select attribute. When I do it manually by selecting corners of BOX or CROSSING, every going all right. When I include this into SCRIPT file, it said cannot find attribute. Probably, it still selecting object in Model Space, instead of Paper Space where my title block is located.
Anybody can help?
Thanks.
Is there any way to create script file to change attribute in title block in Paper Space.
When I created script file started with command -ATTEDIT, seams every going well untill when required to select attribute. When I do it manually by selecting corners of BOX or CROSSING, every going all right. When I include this into SCRIPT file, it said cannot find attribute. Probably, it still selecting object in Model Space, instead of Paper Space where my title block is located.
Anybody can help?
Thanks.
Stephan – Admittedly such classes are rare. I know the local community college here has an AutoCAD Customization class, which among other customization topics does discuss scripts.
Aside from that, Autodesk University tends to have at least a couple classes on just about every imaginable topic related to CAD. Pre-registration just opened last week, and general registration will fire up here soon. Of course if you cannot make it to AU, subscription customers are able to access the previous years materials. If you’re not a subscription customer, AUGI also makes some past AU materials available.
Stephan – Admittedly such classes are rare. I know the local community college here has an AutoCAD Customization class, which among other customization topics does discuss scripts.
Aside from that, Autodesk University tends to have at least a couple classes on just about every imaginable topic related to CAD. Pre-registration just opened last week, and general registration will fire up here soon. Of course if you cannot make it to AU, subscription customers are able to access the previous years materials. If you’re not a subscription customer, AUGI also makes some past AU materials available.
donnie, i was wondering if there were any workshops or classes on Autocad scripting? i know of some rhino ones going on, but im more comfortable and proficient in CAD, so any info would be amazing. THanks in advance!
donnie, i was wondering if there were any workshops or classes on Autocad scripting? i know of some rhino ones going on, but im more comfortable and proficient in CAD, so any info would be amazing. THanks in advance!
@ Abhiraj – Provided you save the file as a .SCR file AutoCAD will recognize it. Do note the only thing which should be included in the script file is the commands you would otherwise type at the command line.
@ Gabriela – There are a number of Batch Script Processors out there. One of the guys in my local user group developed one he has made available for free on our LUG site (http://ramlug.org/index.php?option=com_docman&task=cat_view&gid=38&Itemid=55)
@ John – I have run into some limitations using scripts. A cool thing about scripts is the fact that you can also include some basic LISP within them as well. You may try using the LISP function (command “some command” “prompt”).
@ Abhiraj – Provided you save the file as a .SCR file AutoCAD will recognize it. Do note the only thing which should be included in the script file is the commands you would otherwise type at the command line.
@ Gabriela – There are a number of Batch Script Processors out there. One of the guys in my local user group developed one he has made available for free on our LUG site (http://ramlug.org/index.php?option=com_docman&task=cat_view&gid=38&Itemid=55)
@ John – I have run into some limitations using scripts. A cool thing about scripts is the fact that you can also include some basic LISP within them as well. You may try using the LISP function (command “some command” “prompt”).
In a script I’m trying to create a layer $-Notes and then set that layer current. I’m getting strange extra key strokes entered during the process. I tried the name in quotes and no luck either. the cript works fine if I just use the name Notes. Has anyone heard of a problem with using a $ in a layer name in a script?
In a script I’m trying to create a layer $-Notes and then set that layer current. I’m getting strange extra key strokes entered during the process. I tried the name in quotes and no luck either. the cript works fine if I just use the name Notes. Has anyone heard of a problem with using a $ in a layer name in a script?
How can I do a script for a whole folder?
How can I do a script for a whole folder?
I am a software Engineer in Construction Firm, in our software the script file that are generated are not supported by autocad 2004, Can you suggest me
I am a software Engineer in Construction Firm, in our software the script file that are generated are not supported by autocad 2004, Can you suggest me
David – I too find myself doing a lot of work at home, and don’t always want to VPN into the office. For that reason I do generally keep a local copy of our support paths. Where you are currently using ARG files to fire off an in-office and out-of-office environment – I just switch drive mappings.
Basically you could create 2 BAT files; in-office.bat and out-of-office.bat
Your in-office.bat would look something like:
Net Use M: /D
Net Use M: \\servername\shared folder
Your out-of-office.bat would look something like:
Net Use M: /D
Net Use M: \\local machine name\copied support directory
Hope that helps,
Donnie
David – I too find myself doing a lot of work at home, and don’t always want to VPN into the office. For that reason I do generally keep a local copy of our support paths. Where you are currently using ARG files to fire off an in-office and out-of-office environment – I just switch drive mappings.
Basically you could create 2 BAT files; in-office.bat and out-of-office.bat
Your in-office.bat would look something like:
Net Use M: /D
Net Use M: \servernameshared folder
Your out-of-office.bat would look something like:
Net Use M: /D
Net Use M: \local machine namecopied support directory
Hope that helps,
Donnie
hey,
I am the IT Manager for an Architectural firm and I wondering. We have users that are on laptops. When in the office they launch Autocad using an .arg that defines support path on the LAN. When on the road, they use a different .arg that points to the local hard drive…
Hince the problem… we have to go into each tool pallet and re-define the tool to look on c:\autocad\support.
So every time I change one setting, say adding a new graphic symbol, I have to edit both .arg’s.
is there any way to set a system varible to handle this for me…
Say
roadpc = C:\autocad\support\…
homepc = M:\autocad\support\…
where do I define the varibles so that autocad will pick it up on lauch?
hey,
I am the IT Manager for an Architectural firm and I wondering. We have users that are on laptops. When in the office they launch Autocad using an .arg that defines support path on the LAN. When on the road, they use a different .arg that points to the local hard drive…
Hince the problem… we have to go into each tool pallet and re-define the tool to look on c:autocadsupport.
So every time I change one setting, say adding a new graphic symbol, I have to edit both .arg’s.
is there any way to set a system varible to handle this for me…
Say
roadpc = C:autocadsupport…
homepc = M:autocadsupport…
where do I define the varibles so that autocad will pick it up on lauch?
Hello and many thank you’s – I successfuly wrote my first script file to print my drawings to PDF. It has saved me from a very monotonous task!!
I have one question though – it is possible to make this into an icon on a toolbar within CAD OR a command on a drop down menu??
Hello and many thank you’s – I successfuly wrote my first script file to print my drawings to PDF. It has saved me from a very monotonous task!!
I have one question though – it is possible to make this into an icon on a toolbar within CAD OR a command on a drop down menu??
Gill – I’m not sure I understand your question. There is a command line version of the XREF command; -XREF. As for running a given script file on multiple drawings, there are some batch script processors out there. There’s actually a free one available on my LUG’s website http://www.RAMLUG.org. Not sure if that helps you out or not?
Gill – I’m not sure I understand your question. There is a command line version of the XREF command; -XREF. As for running a given script file on multiple drawings, there are some batch script processors out there. There’s actually a free one available on my LUG’s website http://www.RAMLUG.org. Not sure if that helps you out or not?
HOW CAN I USE XREF OF MANY DWG USING SCRIPT FILE
HOW CAN I USE XREF OF MANY DWG USING SCRIPT FILE