Can't always add instanceobject to the Rhino Doc

Hi there,

When I run the following line of code:
var guid = doc.Objects.AddInstanceObject(instanceDefinitionIndex, planeToPlaneTransform);
(See: ObjectTable.AddInstanceObject Method (Int32, Transform))

It sometimes returns Guid.Empty, indicating that it did not successfully added the instanceobject to the document. Could you provide me with some information on why this might have happened?

Thanks in advance,

Jeroen

Hi @jeroenvanlith,

ObjectTable.AddInstanceObject can fail the instance definition index is invalid, if the instance transformation is invalid, cannot be inverted, or is singular.

There might be other reasons too.

ā€“ Dale

1 Like

Thank you Dale!