nicolas Posted February 15, 2012 Posted February 15, 2012 Hi, I am looking for a way to insert a block from the tool palette using Autolisp. Initially the block is not found in the drawing. There is no listing in insert dialogue box and the source file containing multiple blocks is not in the support autocad paths. Also, can I apply ssget to use a block as boundary and all that's therein including viewports, texts, other blocks ..., also to use the leftmost bottom point of the block as base point for move/copy operations. Thanks. Regards, Nicolas. Quote
pBe Posted February 15, 2012 Posted February 15, 2012 (edited) Hi, I am looking for a way to insert a block from the tool palette using Autolisp. Initially the block is not found in the drawing. There is no listing in insert dialogue box and the source file containing multiple blocks is not in the support autocad paths. Depends on the way you create the tool palette , I use Design Center. it creates a "link" from the "source" , but when sombody inadvertently delete/move the file, then you're hosed. You can however use a lisp program on tool palettes [not a link to a block but a call to a lisp code]wherein it will invoke tblsearch and/or findfile (with a specific folder list not limited to the ones listed on SFSP) Hi, Also, can I apply ssget to use a block as boundary and all that's therein including viewports, texts, other blocks ..., also to use the leftmost bottom point of the block as base point for move/copy operations. Thanks. look into vla-getboundingbox (vlax-invoke vla-object 'Getboundingbox 'll 'ur) where ll variable is the "leftmost bottom point".. HTH Edited February 15, 2012 by pBe Quote
BlackBox Posted February 15, 2012 Posted February 15, 2012 Nicolas - Why not simply add the desired path to Support File Search Paths (SFSP)? Why attempt to invoke a Tool Palette button from LISP, instead of just coding a simple LISP that does what you want? Pbe - Don't forget either SafeArray->List, or VariantValue Methods on LL, UR (I forget which is needed for Vital LISP syntax). LoL Quote
pBe Posted February 15, 2012 Posted February 15, 2012 Pbe - Don't forget either SafeArray->List, or VariantValue Methods on LL, UR (I forget which is needed for Vital LISP syntax). LoL Right on RenderMan (vlax-safearray->list ll) Quote
nicolas Posted February 16, 2012 Author Posted February 16, 2012 Hi, The block is not in the current drawing but on a different dwg containing multiple blocks (a library of block to be exact). Hence my use of the palette. Now I want to insert the same block twice, using their base points to specified coordinates. They need to be inserted as exploded. I am totally ignorant of visual lisp hence my difficulty to follow the discussion through I do have a general knowledge regarding user-defined commands in autolisp. Thanks. Regards, Nicolas. 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.