Occurrences.addByInsert Method
Parent Object:
OccurrencesDefined in namespace "adsk::fusion" and the header file is <Fusion/Components/Occurrences.h>
Description
Method that inserts an existing file.
Syntax
"occurrences_var" is a variable referencing an Occurrences object.returnValue = occurrences_var.addByInsert(dataFile, transform, isReferencedComponent)
|
"occurrences_var" is a variable referencing an Occurrences object.
#include <Fusion/Components/Occurrences.h>
returnValue = occurrences_var->addByInsert(dataFile, transform, isReferencedComponent);
|
Return Value
Occurrence |
Returns the newly created occurrence or null if the insert failed. Insert will fail if the dataFile being inserted is not from the same project as the document it is being inserted into while isReferencedComponent is True. |
Parameters
dataFile |
DataFile |
The dataFile to insert. |
transform |
Matrix3D |
A transform that defines the location for the new occurrence. |
isReferencedComponent |
boolean |
Indicates if the insert is to be an external reference or embedded within this document. This method will fail if the dataFile being inserted is not from the same project as the document it is being inserted into while isReferencedComponent is True. |
Samples
Save and Insert File API Sample |
Demonstrates creating save a new file and then inserting it into a design. To use this sample, have a design open that has been saved and run the script. It will create a new design that contains a cylinder, save it to the same folder the active design was saved to, and then insert it into the active design. |
Version
Introduced in version September 2015