.NET

Reply
Distinguished Contributor
greg.h
Posts: 165
Registered: ‎04-10-2005
Message 1 of 3 (166 Views)

Copy Dynamic Block Problem

166 Views, 2 Replies
02-07-2007 01:13 PM
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)
*Tony Tanzillo
Message 2 of 3 (166 Views)

Re: Copy Dynamic Block Problem

02-08-2007 08:52 PM 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)
Distinguished Contributor
greg.h
Posts: 165
Registered: ‎04-10-2005
Message 3 of 3 (166 Views)

Re: Copy Dynamic Block Problem

02-14-2007 10:53 AM 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!