Xref object Make it Editable
-
Hi,
There are several XRF objects in the document, and I want to implement the Make it Editable like in the XRF manager or in Object manager.This is the method I used, but the result is incorrectres = c4d.utils.SendModelingCommand( command=c4d.MCOMMAND_MAKEEDITABLE, list=xref_objs, mode=c4d.MODELINGCOMMANDMODE_ALL, bc=c4d.BaseContainer(), doc=backup_doc) for obj in res: backup_doc.InsertObject(obj)
Thanks for any help!
-
Hey @chuanzhen,
Thank you for reaching out to us. These two, "Make Editable" the command as for example exposed by the context menu of the Object Manager, and "Make Editable" the Xref Manager menu entry, are entirely different things.
Moreover, we do not expose GUIs and their functionalities (e.g., there are no "ObjectManager" or "MaterialManager" classes) but the APIs behind them. This usually means that some finer details of a niche-feature-manager remain unexposed. This is here the case, the XRef Manager functionalities are not exposed.
To emulate this function, you would have to traverse the object tree yourself and then for each
XRef
read the Reference field, load the referenced document, grab its object content and place it in your scene, e.g., replace the Xref with it.
Cheers,
Ferdinand -
@ferdinand Thanks for your reply!