Redefining the Block - Pls help

Redefining the Block - Pls help

Anonymous
Not applicable
350 Views
4 Replies
Message 1 of 5

Redefining the Block - Pls help

Anonymous
Not applicable
Hi There,

Is anyone know how to redefine the block ? Please help...

Following is my requirement :
A1-D > is existing block (internal block -not xref)
A1-D Case.dwg > external block stored in the folder, I want to replace A1-D with this one inside autocad.

I have blockname in variable but did not find any function to redefine it, please help...

Thanks very Much
Bassya
0 Likes
351 Views
4 Replies
Replies (4)
Message 2 of 5

SEANT61
Advisor
Advisor
This posting has an example of just such a process.

http://www.cadtutor.net/forum/showpost.php?p=152020&postcount=13

************************************************************
May your cursor always snap to the location intended.
0 Likes
Message 3 of 5

Anonymous
Not applicable
Thanks for reply,

But the code is not working, I'm using autocad 2009 and changed your code for strBlockName to "A1-D"
and strPath "D:\temp\" it says, End of statement, syntax error at AxDbDocument.

Any trick ? As I said before I want to redefine block with "a1-d" to "a1-d case" out of few blocks in the drawing.
Any straight forward code will be really appreciated.

Thanks
Bassya
0 Likes
Message 4 of 5

SEANT61
Advisor
Advisor
You may not have noticed this note in the linked post:


Make note of the line:

Set ACDbx = ThisDrawing.Application.GetInterfaceObject("Object DBX.AxDbDocument.16") 'set to appropriate version

in the attached code.



In your case it would be:

Set ACDbx = ThisDrawing.Application.GetInterfaceObject("ObjectDBX.AxDbDocument.17") Edited by: SEANT61 on Feb 16, 2009 3:07 AM

************************************************************
May your cursor always snap to the location intended.
0 Likes
Message 5 of 5

SEANT61
Advisor
Advisor
Actually, something I just noticed; you are not actually redefining the geometry of an existing block, you are substituting blocks (i.e., block with block of a different name).


That is a more straightforward process. I don’t have ready made code but, essentially, you just need to:

Iterate all the inserts with .Name “A1-D”, make note of .InsertionPoint, .Rotation, etc.

Delete “A1-D”

Insert “D:\temp\A1-D case” with all of the gathered properties.

************************************************************
May your cursor always snap to the location intended.
0 Likes