Author Topic: Custom Button Help  (Read 3298 times)

0 Members and 1 Guest are viewing this topic.

Andrew H

  • Guest
Custom Button Help
« on: November 03, 2004, 12:14:34 PM »
I was wanting to create a custom button that will insert a particular block into my drawing. I was wanting to account for the situation that a user might be working along and need this block, so all they would do is click this button (even if this block has yet to be imported into the drawing).

Ok, here's the problem...

I want the button commands to automatically import the block into the drawing without the user having to look for it, so I was thinking: add the text "-import;location&name;-insert;XYZ;". The only problem is the "-import" command doesn't exist (the script version of the command), does anyone know of a way to load a block into a drawing from a script style command? Maybe someone has a lisp I could use to achieve this?

hudster

  • Gator
  • Posts: 2848
Custom Button Help
« Reply #1 on: November 03, 2004, 12:31:35 PM »
Here is a block insertion macro
Code: [Select]

^C^C-INSERT;BLOCK_PATH_&_NAME_HERE;0,0;1;1;0;
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

M-dub

  • Guest
Custom Button Help
« Reply #2 on: November 03, 2004, 12:47:04 PM »
Hudster's right.  If you want to pause for user input (rotation in the example below), simply add \ instead of ;.

^C^C-INSERT;O:/DRAWINGS/MENUS-BLOCKS/MISC/162.dwg;\;;

M-dub

  • Guest
Custom Button Help
« Reply #3 on: November 03, 2004, 12:48:10 PM »
Also note that you must use the FORWARD slash (/) in the path instead of a backslash.

Andrew H

  • Guest
Custom Button Help
« Reply #4 on: November 03, 2004, 12:52:46 PM »
Thanks so much for the help. I'll let you know how it turns out.

Andrew H

  • Guest
Custom Button Help
« Reply #5 on: November 03, 2004, 01:29:08 PM »
Command works great thanks so much.

Code: [Select]
^C^C-insert;(block location and name);\;;

Code: [Select]
^C^C-insert;(block location and name);r;90;\;;

One thing I thought I would tell anyone else trying to adapt this for their use... you can NOT have any spaces (space bar hits) as AutoCAD will reconize that as a ;

M-dub

  • Guest
Custom Button Help
« Reply #6 on: November 03, 2004, 01:33:25 PM »
I believe you can put them in quotations if you need to.  I personally avoid spaces in our file and directory names whenever possible.

Andrew H

  • Guest
Custom Button Help
« Reply #7 on: November 03, 2004, 01:37:06 PM »
I just saved it to my C:/ directory as I have no control over the server drive names (subcontracted IT department, boo).

I'll try putting it in quotes and let everyone know what happens.

ronjonp

  • Needs a day job
  • Posts: 7533
Custom Button Help
« Reply #8 on: November 03, 2004, 01:44:29 PM »
I see that you are using 2005....why don't you just drag the block that you want to insert on a custom tool pallete? Here you can specify source file location, scale, rotation, layer, linetype.......Am I missing something here?
Much easier than making buttons.

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Andrew H

  • Guest
Custom Button Help
« Reply #9 on: November 03, 2004, 01:46:20 PM »
Because I'm creating the button for someone using 2002.

You're right, if I were creating this for me I would defiantly go the TP route.