Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
tvcad
Posts: 53
Registered: ‎08-26-2003
Message 1 of 3 (37 Views)

Get blocks from other drawings?

37 Views, 2 Replies
01-21-2003 10:26 PM
Looking for an alternative to Design Center for inserting blocks from other drawings. Running A2k, W2k. Problem is that Design Center will not offer to overwrite existing blocks. Its crazy. I ask for the block in the external drawing, and Design Center says "you have to keep what you have".
I know I can purge, then insert, but that can get tedious, especially when updating multiple inserts/references.

Any routines out there? Workarounds? Thanks
*Buzbee, James
Message 2 of 3 (37 Views)

Re: Get blocks from other drawings?

01-21-2003 11:11 PM in reply to: tvcad
"vaughan" wrote:
<<
Looking for an alternative to Design Center for inserting blocks from other
drawings. Running A2k, W2k. Problem is that Design Center will not offer to
overwrite existing blocks. Its crazy. I ask for the block in the external
drawing, and Design Center says "you have to keep what you have".
I know I can purge, then insert, but that can get tedious, especially when
updating multiple inserts/references.
Any routines out there? Workarounds? Thanks
>>

No easy solution. For "importing" blocks from external drawings do a search
on this NG for "ObjectDBX". There you will find plenty of code for opening
an external drawing and using the copyobjects method for accessing all kinds
of objects.

Now for the overwriting part: someone may have a more eloquent solution but
mine would be to rename the block you plan to overwrite BEFORE importing the
new block, like "MyBlock" --> "MyBlock-trash". Then iterate through the
mspace and pspace blocks searching for all instances of "MyBlock-trash" and
replacing it with "MyBlock". Then of course delete "MyBlock-trash" from the
blocks collection.

jb
*Friedrich, Peter
Message 3 of 3 (37 Views)

Re: Get blocks from other drawings?

01-22-2003 01:08 AM in reply to: tvcad
To overwrite...

place a copy of the desired block in DWG form
within your search path

 

command: -Insert

old_block_name=new_block_name

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Looking
for an alternative to Design Center for inserting blocks from other drawings.
Running A2k, W2k. Problem is that Design Center will not offer to overwrite
existing blocks. Its crazy. I ask for the block in the external drawing, and
Design Center says "you have to keep what you have".
I know I can purge,
then insert, but that can get tedious, especially when updating multiple
inserts/references.

Any routines out there? Workarounds? Thanks

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.