AutoCAD/Autocad LT script to macro
Expert: Bill DeShawn - 4/21/2006
QuestionHey Bill,
I have a real odd, but I would think simple question.
Let me explain what I am doing and why, it may make sense..
I have a number of functions that are done in all our drawings, but slightly differently depending on which client.
My goal is to have one set of tools that work on nearly all clients for all similer functions, which I am close to doing.
These tools automatically set dims on the correct layer in the correct dimstyle in the correct scale, or select the proper hatch pattern, put it on the proper layer at the proper rotation etc.
But I am having a hard time with the ones to insert various symbols, lets take inserting a vertical section marker for instance;
The client may have a particular layer it needs to be on and the scale needs to be passed. Also, it may need extra things like a pline tail that needs to be drawn (different for each instance because you can't predict the tails location.)
So I have a macro that gets the client id from the drawing (useri5) and uses that to open the appropriate script file
script;insert_vsm_$m=$(getvar,useri5);
This script is client specific and puts you into the correct layer and such, but for some of these tools I need to take user input and/or diesel processing (for dimscale so I can properly size the block for instance), which you cannot do with a script, so I am looking for that script to call a macro to carry on from there. I can have a ton of macros like this and not clutter up drawing space because they would be called by name and no toolbar need be open for them. This way one button will have access to a large number of custom functions determined by the client id of the drawing.
But how can I call a particular macro, its probably simple, but I am choking on it.
AnswerLt is VERY limited as you must know. You're not going to get a script to call up a macro. But you can get a macro to call up a script. Also, you can create cascading pull-down menus that may be identical in nature, but have client specific functions each different from all the others. You can even create image menus to insert client specific blocks. Look here:
http://my.sterling.net/~bdeshawn/custom.gif
The possibilities are endless. One great big thing that I would do if I were you, is to purchase a license for DRCAUTO in order to get AutoLISP capabilities with AutoCAD LT. Getting free routines for LISP is easy, and now DRCAUTO LT Toolket MAX supportx VLISP functions, ObjectDBX and ObjectARX. Pricing is found here:
https://estore.drcauto.com/lttoolkitmax.htm
Description is found here:
http://www.drcauto.com/ltfactory/products/lttoolkitmax/index.html
$450.00 per workstation is not a large investment. You chose LT, because it was less expensive than Full AutoCAD. I understand your need to avoid the high price of CAD. But if you spent $450.00 on one workstation to try it out, I'm sure you would not be disappointed. There is even a link to get a trial download of the toolkit so you can try now and buy later. I sound like a salesman but I am not. It's just that I really feel for those who do AutoCAD without LISP. I wouldn't be able to function in my work without it. It's a necessity. You don't really have to know how to program, but you will have to learn how to use load and run it so that when you get routines, you will be able to use them. OK. I'm going to take a chill pill and let you decide.
Back to your menu. If you cascade the drop-downs by category, you will not clutter up drawing space.
You can also use your screen menu by calling up the screen menu from your drop-down. Try this in a button or menu macro: $S=ERASE
So, if you want to see options in your Screen menu for user input, that's one place you can put them so you can just click on them with a mouse.
Let me know how it goes.
Keep in touch
Bill DeShawn
http://my.sterling.net/~bdeshawn