Hello,
I am trying to figure out a way to insert a specific block using a custom button. If possible, I would like the macro to be able to look up the block by using the support files search paths.
Any ideas on how I can do this?
Thanks!
Hello,
I am trying to figure out a way to insert a specific block using a custom button. If possible, I would like the macro to be able to look up the block by using the support files search paths.
Any ideas on how I can do this?
Thanks!
I think this is what you are asking:
Type in your macro line in the CUI the following:
AutoCAD will search the support path for the file, and insert the first instance it finds.Code:^c^c-i;filename.dwg;
Why draw straws? Just draw one straw and array it.
Scott Wilcox - Edmonton, Alberta
Hi "khorzan" ( Sorry, I do not know your real name )
Please note I have *moved* this thread from the AutoCAD Tips & Tricks forum to this one, as I feel this particular forum is a more appropriate place for such a topic.
Thanks, Mike
Forum Manager
^c^c-i;filename.dwg;
Does "filename.dwg" need to be in quotation marks in the above example.
Last edited by kastmiler; 2006-04-14 at 02:47 AM.
Generally, when making button macros like the one you are trying to make, you type in the command exactly as you would at the command prompt. use a semi-colon ( ; ) as a return and a backslash (\) as a user input. the ^C^C cancels an active command if you want to do that, otherwise you can use an apostrophy ( ' ) to make a transparent command.
If the filename contains spaces then place it within quotes.Originally Posted by kastmiler
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt
Here is what I did. ^C^C_-insert;"file name";scale;1
Now, you can add extra commands such as scale and so forth to get the desired effect you want. I did our entire MEP block library this way before tool palettes and such came around. I still use them to insert the blocks I need for everyday drawings. Just make sure your library folder is in your search path.
Just a side note here: Macros are great but you can't repeat them unless you click on the button again. If you turn it into a lisp, you can repeat it with a right-click or by hitting enter.
Lance McHatton
AutoCAD Architecture 2008
Windows Vista
I swear, I did not dado that rabbet.
A more simple approach is to put a number of blocks into a single .dwg file, then create a new tool pallete from that file. Grouping the blocks by purpose (standard notes, item callout bubbles, fasteners, etc), helps to provide quick access to common blocks without adding additional icons on toolbars.