dhl Posted October 14, 2009 Posted October 14, 2009 This would seem to be the simplest of things, but after googling for some time it seems all but simple. Question: How do you insert a block through lisp from an external dwg containing multiple blocks? Example: I have a dwg file that contains all my blocks and whatever that I want to use in the current dwg file. In the current dwg file I would want to insert a block through a lisp command to be able to for instance scale automatically etc. I've been experimenting with (command "-.insert" "c:/yada/yada/yada.dwg&blockname=yada" "" "" "") but had no luck so far. Is this as simple as it should be? Quote
GE13579 Posted October 14, 2009 Posted October 14, 2009 I know nothing about Lisps, but wonder if the blocks are all on the same drawing, might it be easier if you were to save each block to it's own drawing? Quote
David Bethel Posted October 14, 2009 Posted October 14, 2009 You need to first INSERT the 'parent' dwg. It will bring in the 'child' BLOCK table definitions and then you can INSERT them. (command "_.INSERT" parent_dwg) (command) (command "_.INSERT" child_block) (while (> (getvar "CMDACTIVE") 0) (command pause)) Just curious, why not use a template? -David Quote
dhl Posted October 14, 2009 Author Posted October 14, 2009 thanks both of you. It seems weird to not be able to load a block from a dwg with several blocks, for creating purposes its much easier to have one file with all blocks, especially when many block are similar. How do you mean template? As in have a template file which load all the blocks in every new drawing? This would probably increase filesize and decrease performance considerably. Quote
Glen Smith Posted October 14, 2009 Posted October 14, 2009 You could load the block drawing at startup as your drawing 1, then just copy the blocks that you want to insert to your new drawing. But why not create a palette with all your blocks on it? Dock it with autohide on the side of your drawing space. When you need a block, you mouse over the palette, grab what you want and drop it into your drawing. It's much easier than opening your block template drawing every time you need a new block. Glen Quote
dhl Posted October 14, 2009 Author Posted October 14, 2009 I'm not a big fan of pallettes, too slow, too much hazzle. I like writing my instructions on the command prompt, the less I use the mouse the happier I am This is probably since I haven't taken the time to learn and customize, but still it seems slow to me. Using lisp or vba routines to insert, manipulate, customize is much better in my eyes, and I'm just starting to learn programming. Quote
alanjt Posted October 14, 2009 Posted October 14, 2009 I'm not a big fan of pallettes, too slow, too much hazzle. but Tool Palettes will set/create the layer, allow for appropriate scaling, allow xref or insert, explode, rotate, insert child block within drawing, etc, and it's all nicely placed in a floating, dockable palette. Don't get me wrong, I write plenty of code for customization, but Tool Palettes is a treasure trove of possibilities. Quote
Glen Smith Posted October 14, 2009 Posted October 14, 2009 but Tool Palettes will ..., allow for appropriate scaling, ... Alan, Do tell, Palettes can handle scaling the block as well? I have a couple in my pallet that need to be at different scales (my view title block). It looks fine on floor plans but is rather big on wiring diagrams. How does this work? Glen Quote
alanjt Posted October 15, 2009 Posted October 15, 2009 Alan, Do tell, Palettes can handle scaling the block as well? I have a couple in my pallet that need to be at different scales (my view title block). It looks fine on floor plans but is rather big on wiring diagrams. How does this work? Glen Heck yeah, once a block has been dragged into Tool Palettes, right-click on it and explore Properties. So many options. You can even drag a piece of text/multileader/etc. into TP and when you click on it, it will set to correct layer, style, and execute the function. For a quick way to make palettes, you can right-click on a selection in Design Center and create a completely new palette. Quote
Recommended Posts
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.