Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Insert diffrent block same dwg ussing lisp?

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
369 Views, 4 Replies

Insert diffrent block same dwg ussing lisp?

Hi,

 

I know how to insert a block ussing the following lisp...

 

(command "_.insert" "*C:/MYBLOCK.dwg" (polar MYPOINT 0 MYDIST) "" "" "")

 However I hate this code because I need to have a dwg file for every single block I want to insert using this lisp. In some  cases I want several relating blocks to be found in the same DWG.

 

Is there a lisp code, that not just allows me to insert a dwg as a block but rather select a specific block from a parent dwg file? that way I can have a parent dwg with all the realting blocks contained with in the one dwg, instead of one block per dwg?

 

EDDIT:

 

Afterall this is posible with toolpalettes (But I dont want toolpalettes for this case senario)

4 REPLIES 4
Message 2 of 5
hmsilva
in reply to: Anonymous

Take a look at the CBO program, by Fatty T.O.H (c) 2004 should give you some ideas

 

HTH

Henrique

EESignature

Message 3 of 5
dbroad
in reply to: Anonymous

The approach I took before objectdbx was available, was to check to see if a block needed was already in the block table and if not, to insert the source drawing and either cancel the insertion or delete the insertion so that the block definitions were available.

pseudo code

(if (not (tblsearch "myblock"), (progn then insert parent and delete. ))

...proceed to insert the block

 

It has worked well over many years.

 

Downside would be if the entire library of blocks in the drawing causes file sizes to be inflated.  Also with palettes, you can more easily redefine and edit the source blocks.  So I have since switched completely to palettes.

 

Architect, Registered NC, VA, SC, & GA.
Message 4 of 5
Kent1Cooper
in reply to: Anonymous

Try the Design Center [ADCENTER command, or its alias ADC, or Ctrl-2].  With it, you can Insert an individual Block from within any other drawing.

Kent Cooper, AIA
Message 5 of 5
Kent1Cooper
in reply to: Kent1Cooper


@Kent1Cooper wrote:

Try the Design Center ....


[Oh....  Actually, never mind -- I don't know of a way to use that in a Lisp routine.]

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost