XRef Reference
-
On 23/02/2016 at 08:03, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R17
Platform: Mac OSX ;
Language(s) : C++ ;---------
Hi,I'm trying to set the reference file of an XRef object but without success.
I tried with SetFilename on ID_CA_XREF_FILE and ID_CA_XREF_REF_NAME.
I know there is a limitation for doing so with Python, but is it possible to do it with C++?Originally posted by xxxxxxxx
I'm afraid it's not currently possible to set the file for an XRef object.
Actually the issue isn't related to XRef objects. The real limitation is that Filename parameters cannot be set. We're aware of it and we'll try to fix it ASAP.
Thanks in advance!
-
On 24/02/2016 at 01:19, xxxxxxxx wrote:
Hi Yann,
There isn't such a limitation with C++ but C4DAtom::SetParameter() has to be called with DESCFLAGS_SET_USERINTERACTION flag to set ID_CA_XREF_FILE:
BaseObject* xref = BaseObject::Alloc(Oxref); if (xref) { doc->InsertObject(xref, nullptr, nullptr); Filename xrefFile = "path/to/xref.c4d"; xref->SetParameter(ID_CA_XREF_FILE, xrefFile, DESCFLAGS_SET_USERINTERACTION); EventAdd(EVENT_ANIMATE); }
Note the Python limitation with Filename parameters was fixed in R16 SP3 (R16.050).
-
On 24/02/2016 at 02:51, xxxxxxxx wrote:
Hi Yannick,
Thank you very much for you help.
It seems to work with the flag DESCFLAGS_SET_USERINTERACTION to set ID_CA_XREF_FILE and DESCFLAGS_SET_PARAM_SET to set ID_CA_XREF_REF_NAME.I'm trying to replace an existing Xref reference by a copy of the referenced file located somewhere else and with a different name.
Is there a simple way to get rid of the dialog message, to perform a transparent operation without interacting with the user?
_<_img src="http://www.xsyann.com/fc4d/xref.png" height="268" width="540" border="0" /_>_
I can avoid this dialog by replacing C4DOS.Ge->OutString by a function returning GEMB_R_YES before the call and then restore the orignal one after, but maybe there a more proper way to do it...
-
On 25/02/2016 at 02:27, xxxxxxxx wrote:
Hi Yann,
Originally posted by xxxxxxxx
Is there a simple way to get rid of the dialog message, to perform a transparent operation without interacting with the user?
_<_img src="http://www.xsyann.com/fc4d/xref.png" height="268" width="540" border="0" /_>_I can avoid this dialog by replacing C4DOS.Ge->OutString by a function returning GEMB_R_YES before the call and then restore the orignal one after, but maybe there a more proper way to do it...
We can't recommend such hacky solution but it's the only way to get rid of the dialog...