.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Copy Dynamic Block Problem

2 REPLIES 2
Reply
Message 1 of 3
greg.h
410 Views, 2 Replies

Copy Dynamic Block Problem

In a drawing i want to find a list of objects enclosed by a polyline, copy them to a clear area of model space and then interrogate them. It is all working fine except for some dynamic blocks. When they are copied they lose their link to the main block. When trying to interrogate the copied version by code their name always come ups as *Uxxxx (even when getting the DynamicBlockTableRecord reference). If you try to edit the copied block you get a "Cannot edit anonymous reference". Any ideas on how to change the copy routine so that the dynamic blocks don't get broken (sample code is attached)
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: greg.h

Try using the DeepCloneObjects() method of the
Database instead of GetTransformedCopy()


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5478787@discussion.autodesk.com...
In a drawing i want to find a list of objects enclosed by a polyline, copy them to a clear area of model space and then interrogate them. It is all working fine except for some dynamic blocks. When they are copied they lose their link to the main block. When trying to interrogate the copied version by code their name always come ups as *Uxxxx (even when getting the DynamicBlockTableRecord reference). If you try to edit the copied block you get a "Cannot edit anonymous reference". Any
ideas on how to change the copy routine so that the dynamic blocks don't get broken (sample code is attached)
Message 3 of 3
greg.h
in reply to: greg.h

Tony
Thanks for the reply
When looking at my problem again (this time not being half asleep), I realised that when a dynamic block is copied by the GetTransformedCopy method, the original Anonymous name and the copied anonymous name are the same, By keeping a map of the original Anonymous vs Real block name, when interogating the copy I can just look up in the map and get the real name.

I did look quite heavily into the DeepClone method though and a problem coming up may be solved by this so thanks again
Regards

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost