PDA

View Full Version : Insert a Block from a Tool Palette



chris.kulhanek
2006-07-10, 08:54 PM
what is wrong with this line of code for a custom button on the palette?

^C^C(INSERT"T:/2005/Clients/BPXA/Blocks/0INLINE.dwg")

i'm trying to insert a block, and i want the block pre set. thanks for the help.

BrenBren
2006-07-10, 09:27 PM
I think first you have to use the command line version of insert -insert

I'm not sure after that, however. I guess when I want to insert a block from a tool palette, I just create a tool palette of those blocks and then drag and drop. Seems a little easier than creating a tool to insert a block.

.T.
2006-07-10, 09:48 PM
Hi,

Try this:


^C^C(command "-insert" "T:/2005/Clients/BPXA/Blocks/0INLINE.dwg")

as your menu macro.

You can also specify scale, etc. at the same time if you want, and you can use the PAUSE function to wait for input:


^C^C(command "-INSERT" "T:/2005/Clients/BPXA/Blocks/0INLINE.dwg" "S" (getvar "dimscale") (getpoint "\nInsert point: ") pause)
This inserts the 0inline block at dimscale, prompts for the insert point, then pause waits for the rotation (as an example).

HTH :)

rkmcswain
2006-07-10, 10:22 PM
Tim

As Brenda said. Doesn't all that defeat the purpose of using a tool palette button? You can set the scale, rotation, layer, color, etc. in the properties of the tool palette tool itself.


Chris
As far as the original macro, unless you have a lisp function named INSERT, this won't work.

You could use something like this.


^C^C-insert;T:/2005/Clients/BPXA/Blocks/0INLINE.dwg


Use Tim's suggestion if you want to use a lisp statement instead of a menu macro.

.T.
2006-07-10, 10:48 PM
Tim
As Brenda said. Doesn't all that defeat the purpose of using a tool palette button? You can set the scale, rotation, layer, color, etc. in the properties of the tool palette tool itself.


My interpretation (which is probably incorrect, now that I read the title), based on the code the OP posted, was the OP was trying to make a button on a toolbar and had a terminology malfunction (tool palette = toolbar), hence the code and attempt to nudge a little further into lisp. ~shrug~ :)

I guess we'll have to wait and see.

rkmcswain
2006-07-10, 10:57 PM
My interpretation (which is probably incorrect, now that I read the title), based on the code the OP posted, was the OP was trying to make a button on a toolbar and had a terminology malfunction (tool palette = toolbar), hence the code and attempt to nudge a little further into lisp.

Yep, I can see that now.....



I guess we'll have to wait and see.

Yes. ;-)