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

AcDbBlockTableRecord & deepCloneObjects()

2 REPLIES 2
Reply
Message 1 of 3
jason.teagle
1050 Views, 2 Replies

AcDbBlockTableRecord & deepCloneObjects()

We have a cloning function that basically does a little housework, and then calls AcDbDatabase::deepCloneObjects().

 

I already know that if you try to clone an AcDbBlockReference, it clones *only* the block ref, and not the entities it contains; this can be considered a 'feature', in that it is creating another inserted copy of the same block entities. Fair enough. 

 

For all other objects so far, including custom objects of ours, it works just fine. But I'm having a problem now with an AcBlockTableRecord object - deepCloneObjects() returns eIllegalEntityType. Why can't I clone this? I need to end up with a cloned record, and all of its contained entities cloned. 

 

2 REPLIES 2
Message 2 of 3
owenwengerd
in reply to: jason.teagle

Is there a proxy object in the BTR? If so, you may need to create a new BTR, then deepclone each entity in the source BTR, skipping any that refuse to be deepcloned.

--
Owen Wengerd
ManuSoft
Message 3 of 3
jason.teagle
in reply to: owenwengerd

In this case I don't believe so, they should have been only lines and text objects. I was certainly able to do exactly what you described to get the cloned set, I just wondered why it would not allow it to be cloned directly. I admit I didn't specifically check if anything refused to be cloned, as I was only interested in keeping what *did* clone... I should at least check if something failed during that process.

 

Thank you for the suggestion.

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

Post to forums  

Autodesk Design & Make Report

”Boost