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)
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.
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.
@Kent1Cooper wrote:
Try the Design Center ....
[Oh.... Actually, never mind -- I don't know of a way to use that in a Lisp routine.]