Forum Discussion
Former_Member
9 years agoIdeator I
I had issues with this error as well when trying to add CAD documents to a part.
Is there a difference in using the functions to create the relationships versus setting the ids themselves? Is there anything else that happens or is there any validity checking that happens?
Here is how I did it.
Item cadDocument = myInnovator.newItem("CAD", "add");
cadDocument.setFileProperty("native_file", cadfile);
cadDocument.setProperty("classification", @"Mechanical/Drawing");
cadDocument.setProperty("authoring_tool", "AutoCad");
Item docRelationship = _innovator.newItem("Part CAD", "add");
docRelationship.setRelatedItem(cadDocument); // here is the linkage to the related item
part.setAction("edit");
part.addRelationship(docRelationship); // here is the parent (source?) item
Item addPartRelationship = part.apply();
if (addPartRelationship.isError())
{ ... }