Dxf Attribute definitions coping twice on adding it a target dwg from an external dwg
![]() 5/6/2022 12:47 PM
|
---|
Hi, My requirement is to copy specific block along with its attributes from an external drawing to an existing drawing. I have the below code. When I open the manage attributes in AutoCad I see all the definitions in red and being duplicated. I tried two ways, First is directly fetching the attributes from the DxfInsert. Second is to create a attribute definition and adding the attribute. Both have the same result. I constructed this code following many examples on this forum. Not sure where I have gone wrong here. Any help is appreciated! C# Code: private void InsertSourceBlockInTargetModel( |
![]() 5/6/2022 2:22 PM
|
---|
Hi, When you clone the block, its entities are already cloned. But then you clone the block's entities yourself, so this is problably the problem. Also cloneContext.ResolveReferences() needs to be outside the foreach loop. - Wout |
![]() 5/10/2022 6:33 AM
|
---|
Thanks for the hint. That worked! |