ComponentOccurrences.AddByComponentDefinition Method
Parent Object:
ComponentOccurrences
Description
Method that creates a new for a new part or subassembly. This method is the equivalent of the 'Create Component' command.
Syntax
ComponentOccurrences.
AddByComponentDefinition(
CompDef As
ComponentDefinition,
Position As
Matrix ) As
ComponentOccurrence
Parameters
CompDef |
ComponentDefinition |
Input object that will be referenced when creating the new occurrence. |
Position |
Matrix |
Input object that defines the location and orientation to position the occurrence. |
Samples
Demote occurence |
This sample demonstrates how to demote a top level occurrence in an assembly into a new sub-assembly occurrence. |
SurfaceBody Copy |
This sample demonstrates copying a surface body from one part to another. This is equivalent to the Promote command, but the API is much more flexible. In order for the sample to be self-contained, it creates two parts on the fly that will be used to demonstrate copying a body from one part to another. When copying a body into a part, you provide the surface body and a matrix to define its position in the new part. This sample creates a matrix based on the position of these parts within an assembly. |
Version
Introduced in version 4