Jump to content

Have You Tried: Streamline Tasks With Scripts in AutoCAD


The AutoCAD Blog

Recommended Posts

The AutoCAD Blog

This month’s article for the Have You Tried series focuses on a productivity enhancing technique in AutoCAD: creating scripts. Scripts in AutoCAD can automate repetitive tasks and improving accuracy. Maybe you insert a title block and create several layers when creating a new drawing. A script can help automate that task.   

Instead of starting a command from the AutoCAD user interface and then providing a value or entering an option at the Command prompt, you type and store the command sequence in a plain text file using an application like Notepad.

AutoCAD scripts

In this Have You Tried, we’ll go over how to:

  • Create a script file
  • Manage script files
  • Run a script file in a drawing
  • Run a script from the ribbon
  • Run a script file across multiple drawings using ScriptPro

Learn how to create scripts to improve your productivity with the step-by-step examples in the Have You Tried: Streamline Tasks with Scripts topic.

Keep the Feedback Coming

Thanks for all the great feedback submitted so far. Because of the great feedback, we have been able to improve the topics in the AutoCAD Online Help system.

The best way to submit feedback is by using the “Was this helpful?” section located at the bottom of every Help topic. Let us know what you like or don’t like about a topic or provide suggestions for other subjects that you’d like to see covered in greater detail. The more specific your comments, the better.

The post Have You Tried: Streamline Tasks With Scripts in AutoCAD appeared first on AutoCAD Blog.

http://feeds.feedburner.com/~r/autodesk/AutoCADBlog/~4/t8iJ1oKETwM

View the full article

Link to comment
Share on other sites

Cool! I've been googling whether or not it was possible to recover all previous commands from the command line so one could create a script based on the command history of an existing DWG/DWT file.

 

(Autocad 20201) If you hit F2, you will see the full command line history in a drop down.

You can then use "COPYHIST" command and paste everything into a text file.

 

So if you were compelled to create a script to recreate a specific drawing or template you already have on file, one could use this process (fine tuning it to remove redundant commands if necessary).  Although, depending on the complexity of your existing file, sifting through all that could be mind-numbing.

 

But it would get your drawing up to speed to what you have in your other file(s) should it be needed.


On a side note..

While poking around, I found a 7-lesson tutorial on VisualLISP that is built in to autocad.  Never knew that was there.

Ctrl+2, scroll down to "tutorial", expand, click Visual Lisp, you will see 7 lesson folders there. 

 

It turns out those files in the autocad folder are all part of the below tutorial that was originally implemented back in 2014 or so I guess (possibly earlier).

It is called "Garden Path"

https://help.autodesk.com/cloudhelp/2018/CHS/AutoCAD-AutoLISP-Tutorials/files/index.htm#!

 

The below will bring up a series of links that will guide people through the tutorial.

Thought I would share!

 

-ChriS

Link to comment
Share on other sites

When was 20201 released they just keep making new ones 🤣

 

The down the Garden path has been updated since the original.

 

"Appendix E Tutorial" page 219 R12 Autolisp programmers manual May 1992. ps my bible.

 

What about "Logfile" is that useful also.

Edited by BIGAL
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...