On 18/10/2014 at 11:53, xxxxxxxx wrote:
I've found a couple posts about this but no clear answers.
Is it possible to create an Xref object and pass in a file path using python rather than just opening the dialog to search for it? If so, does someone have a code snippet they can share?
I've got this going so far, but the filepath isn't updating. I guess maybe I need to load a file into the Xref object?
import c4d def main() : op = c4d.BaseObject(c4d.Oxref) rocket = "/component1.c4d" op.GetObjectLink(rocket) op[c4d.ID_CA_XREF_FILE_SELECT] = "component1.c4d" op[c4d.ID_CA_XREF_NAMESPACE] = "rocket" op[c4d.ID_CA_XREF_GENERATOR] = 1 box = c4d.BaseObject(c4d.Ocube) box.SetName("new") doc.InsertObject(box) doc.InsertObject(op) c4d.EventAdd()