Jump to content

Insert Block from Palette Lisp and ssget block


Recommended Posts

Posted

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.

Posted (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 by pBe
Posted

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

Posted

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)

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...