Jump to content

What kinda stuff do you automate?


Sbeth85

Recommended Posts

I've seen people talking about LISPS and API(?) and whatnot...

 

As a beginner, could someone explain to me the TYPES of things one could do with these automated processes and why they'd be useful to learn?

 

I work in an office and I only do 2-D drawings, lots of viewports of differing scales, plotting to JPG. What kinda stuff could be useful for me? Already I have customized my workspace with CUI, so what's the next step on gaining more productivity?

 

Thank you muchly...

Link to comment
Share on other sites

  • Replies 25
  • Created
  • Last Reply

Top Posters In This Topic

  • Sbeth85

    8

  • ReMark

    3

  • Tiger

    3

  • a3dtot

    3

Top Posters In This Topic

I use lisps and macros very seldom, and for very specified reasons.

 

Macros: I have a macro that does Purge, -Purge, Audit and QSave. I have put them all in a macro simply to remember to do them all on all drawings.

I have a macro that does Purge, -Purge, Audit, Ucs/World, Zoom/Extents, LAYON, LAYTHW, QSave - to automate the cleaning process for drawings.

 

Lisps: I have a lisp that places coordinates, I pick a point and then I can place the texts. I can alternate between X/Y and X/Y/Z.

I have a lisp that expands the Break-command to give a few more options.

When I was mainly using AutoCAD I had a lisp that places text with a circle and line and counts up the text.

 

Basically everything you do fairly often, you can automate in some fashion.

Link to comment
Share on other sites

Customization can take many forms such as Toolbars, Tool Palettes, Ribbon (new tabs and panels), etc. Is that how you have customized your workspace?

 

AutoCAD 2014 I see. Have you made use of the Action Recorder for creating macros?

 

Lisp routines come in handy for taking the drudgery out of repetitive tasks. I have a library of about 100 lisp routines that I use for various tasks. What kinds of repetitive tasks can you think of that might benefit from the use of a lisp routine?

Link to comment
Share on other sites

I am not a guru on either, I will give you how I think about the two. Lisps are for more complicated stuff, like a new command type stuff.

 

Macros are simpler, and I think of them more like instead of me typing the command and answering all the prompts, I toss it all in a macro and assign it to a button and then I can just click a button and it rattles through.

 

You can ofcourse be more complicated in a macro, and you can do simpler stuff with a lisp.

 

I am sure a guru will come around shortly and explain where I went wrong :wink:

Link to comment
Share on other sites

Thanks, Tiger and ReMark...

 

Hm, I was taught the following method for cleaning files:

 

1. PU

2. -PURGE and then click on the R to get rid of RegApps

3. -SCALESLISTEDIT and then D to get rid of extra scales (or should I do R to reset??)

4. AUDIT with Y to fix errors

 

 

So the questions are:

1. Do you like that series of 4 things to do to clean up files?

and

2. These are the types of things I can automate and make a MACRO for and then create a button for it for?

Link to comment
Share on other sites

API is the acronym for Application Programming Interface; this may be seen as a door let open by a software developer (in our case Autodesk) for other to write custom tools to extend/improve the base application. In AutoCAD there are 4 API's:

  • AutoLISP,
  • VBA (discontinued, but still available as extension),
  • Object ARX,
  • .Net (read dot Net).

Besides automating repetitive task, a tool developed in one of the above languages may include calculations, data input, interogation of drawing's content or even define custom entities.

Link to comment
Share on other sites

Those are the exact kind of things that I would make a macro for and place on a button.

 

I have LAYON and LAYTHW (turn on and thaw all layers) in my cleaning-macro because I frequently got files that had lots of layers frozen with lots of information that I a) did need and wanted to see or b)didn't need and wanted to delete.

Link to comment
Share on other sites

Re: Cleaning files. Here is a script to follow.

 

-PURGE RE * N

-PURGE ALL * N

TILEMODE 1

AUDIT Y

TILEMODE 0

AUDIT Y

QSAVE

blank line here

Link to comment
Share on other sites

No. These are the commands that would be in a script file. Script files end in the file type .SCR and can be run from within AutoCAD. Script files are very good at batch processing a large number of files unattended.

 

You can emulate the previous commands via the Action Recorder in AutoCAD. They would be saved as a macro. The drawback is you can only run the macro on the drawing that is currently open.

Link to comment
Share on other sites

MSasu, thanks for breaking it down... Though I don't think I need any of the things you mentioned... I am but a lowly 2D draftsperson!

 

API is the acronym for Application Programming Interface; this may be seen as a door let open by a software developer (in our case Autodesk) for other to write custom tools to extend/improve the base application. In AutoCAD there are 4 API's:

  • AutoLISP,
  • VBA (discontinued, but still available as extension),
  • Object ARX,
  • .Net (read dot Net).

Besides automating repetitive task, a tool developed in one of the above languages may include calculations, data input, interogation of drawing's content or even define custom entities.

Link to comment
Share on other sites

toolpallete or toolbar macros are great for those command sequences that you are constantly repeating, silly little things like dimensions, usually go on a separate layer, so you have to set the layer active and then set the dim style and then start the dim command, a macro will do that for you with one button click (if you have 2 standard styles then 2 buttons). Anytime you use a sequence of commands more than a couple of times on a regular basis, then it is worth just seeing if you could create a macro to do it for you. It's great watching a script create several hundred layers with color settings and all the trimmings within a couple of seconds, but it's just as useful to have a button that toggles the ribbon on/off.

Link to comment
Share on other sites

 

As a beginner, could someone explain to me the TYPES of things one could do with these automated processes and why they'd be useful to learn?

 

 

I suspect you are looking for specific productivity types of things, but if you look at it from a cad management POV....

 

We have lisp code that runs at startup that:

Sets the support file search paths

Sets the printer and template paths

Sets certain system variables

Defines other standard lisp functions

Loads some ARX files

Loads the company menu if it's not loaded

Other stuff like this.

 

99% of the time, if someones AutoCAD is acting up, a simple shutdown and restart fixes it.

Link to comment
Share on other sites

Customizing AutoCAD is one of it's greatest features and I would suggest learning as much as you can about each form of customization. I use script files when I have to input tens of thousands of coordinates (no exaggeration) I copy or convert the input data to text and insert into or open with notepad I add "3DLINE" on the first line and I get a 20km pipeline drawn in about 5-10 seconds. I have created a custom menu using the ribbon tabs, tool palettes etc. using macros or lisp behind them. Most of all I use lisp, this is a very powerful tool and anything you can understand how something is done you can write a lisp program to do it. The biggest difference between lisp and macros is that a macro can only do one thing, extremely limited, while a lisp program can be one program that can be applied to many things and only limited by your imagination and ability. My ability is actually quite low in lisp programing and still it is amazing what I have been able to create. My company's cad program is customized to do exactly what we need to it do, no 3rd party program baggage and that's the advantage of customizing, so I would encourage you to learn as much as you can it will only help you in the long run.

Link to comment
Share on other sites

Sbeth85, I use lisp for all things that I know I have to do more than once. Latest examples:

I have to use fillet command (different radius) and "polyline" options:

(defun c:ff1 ()
 (COMMAND "FILLETRAD" "1000")
 (command "fillet" "P" PAUSE)
 )

(defun c:ff2 ()
 (COMMAND "FILLETRAD" "2000")
 (command "fillet" "P" PAUSE)
 )

(defun c:ff3 ()
 (COMMAND "FILLETRAD" "3000")
 (command "fillet" "P" PAUSE)
 )

(defun c:ff4 ()
 (COMMAND "FILLETRAD" "4500")
 (command "fillet" "P" PAUSE)
 )

same about offset:

(defun c:o1 ()
 (command "offset" "1000")
)

(defun c:o2 ()
 (command "offset" "2000")
)

(defun c:o3 ()
 (command "offset" "3000")
)

(defun c:o4 ()
 (command "offset" "4500")
)

and line tangent-tangent:

 

(defun c:ltt ()
 (command "line" "tan" pause "tan" pause "")
 )

Those are "disposable" lisps that I wrote today - I use them a lot on a specific project just to save myself some key presses/clicks/time. They are very simple to create and can save a lot of repetitive work. I have similar sets for printing, purging, renaming layers, inserting blocks, rotating by 90,180,270 deg etc.

 

I suggest to lisp/script all repetitive tasks

 

P.S. I'm just writing another one: remove a certain block, purge, call vba that inserts a company block and fills the content. It's nothing big, but I'll have to repeat those actions on a set of 30 drawing and it's worth to spend 10 minutes to make a lisp to do it for me.

Link to comment
Share on other sites

Also an example of using lisp to do the major work as well. We use a lot of pipe as structural members, piping programs have tons of nonsense that do not apply to our needs as do structural programs. I create the model with single lines at the center line of the pipes, the layer names set the pipe size and wall thickness and when I'm done I use one lisp program to draw in the pipe and another to make the copes of one pipe to another. Others I use match elevation, we only work in 3D, there is so much that can be done with lisp. Like those above I also create the quickie lisp, modify borders, insert blocks any thing I have to do multiple times I create a lisp for it. By the way if any one can write a lisp for the above "easy" button please post.

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