Occurrence Object

Derived from: Base Object
Defined in namespace "adsk::fusion" and the header file is <Fusion/Components/Occurrence.h>

Description

Represents an occurrence of a component at any level within a subassembly.

Methods

Name Description
activate Makes the occurrence the active edit target in the user interface. This is the same as enabling the radio button next to the occurrence in the browser.
boundingBox2 PreviewReturns the bounding box of the specified entity types within the occurrence.
breakLink When the component this occurrence references is an external reference (the isReferencedComponent property returns true), this will break the link and create a local Component that this occurrence will reference. The new local Component can be accessed through the Occurrence using the component property.

This method will fail if the occurrence is not referencing an external component.
classType Static function that all classes support that returns the type of the class as a string. The returned string matches the string returned by the objectType property. For example if you have a reference to an object and you want to check if it's a SketchLine you can use myObject.objectType == fusion.SketchLine.classType().
createForAssemblyContext Creates or returns a proxy for the native object - i.e. a new object that represents this object but adds the assembly context defined by the input occurrence. Fails if this object is not the NativeObject.
deleteMe Deletes the occurrence from the design. If this is the last occurrence referencing a specific Component, the component is also deleted.
getPhysicalProperties Returns the PhysicalProperties object that has properties for getting the area, density, mass, volume, moments, etc of this occurrence.
moveToComponent Moves this occurrence from it's current component into the component owned by the specified occurrence. This occurrence and the target occurrence must be in the same context.
replace Replaces this occurrence or all occurrences that reference the same external component with a new component.

This method will fail if the occurrence is not referencing an external component.
switchConfiguration PreviewChanges which configuration is used for this occurrence. Use the isConfiguration property to determine if this occurrence references a configuration.

Properties

Name Description
appearance Read-write property that gets and sets the appearance override for this occurrence. This property can return null indicating there is no override appearance and that the contents of the occurrence are displayed using there defined appearance. Setting the property to null will remove any override appearance for this occurrence.
asBuiltJoints Returns the as-built joints that affect the position of this occurrence. If the occurrence is a proxy, the as-built joints returned will also be proxies in the same context as the occurrence.
assemblyContext Returns the assembly occurrence (i.e. the occurrence) of this object in an assembly. This is only valid in the case where this references the component the object is defined within. Returns null in the case where the object is not in the context of an assembly but is already the native object.
attributes Returns the collection of attributes associated with this face.
boundingBox Returns the bounding box of this occurrence.
bRepBodies Returns the body proxies for the B-Rep bodies in the component referenced by this occurrence. For example if you get the occurrences from the root component and then use this property to get the bodies from those occurrences, the bodies returned will return information in the context of the root component, not the component they actually exist in.
childOccurrences Returns a read only list of child occurrences where only the occurrences in this occurrence's AssemblyContext are returned .
component The component this occurrence references.
configurationRow PreviewIf this occurrence is a configuration, this property returns the row that defines it. If it isn't a configuration, null is returned.
configuredDataFile PreviewReturns the DataFile object that represents the specific version of the design used by this occurrence. From the DataFile you can access other version of the file, most importantly, you can access the latest version and get the top configuration table from it.
documentReference When the component this occurrence references is an external reference (the isReferencedComponent property returns true), this will return the object that represents that reference. Through the DocumentReference object you can modify the version and get other information associated with the reference.

This property will fail if the occurrence is not referencing an external component.
entityToken Returns a token for the Occurrence object. This can be saved and used at a later time with the Design.findEntityByToken method to get back the same occurrence.

When using entity tokens it's important to understand that the token string returned for a specific entity can be different over time. However, even if you have two different token strings that were obtained from the same entity, when you use findEntityByToken they will both return the same entity. Because of that you should never compare entity tokens as way to determine what the token represents. Instead, you need to use the findEntityByToken method to get the two entities identified by the tokens and then compare them.
fullPathName The name of the occurrence, including the full path of occurrences as seen in the browser. The top-level component will depend on the context but will typically be the root component of the design. A name for an occurrence that is at the third level of an assembly could be "Sub1:1+Sub2:1+PartA:1".
isActive Gets whether this occurrence is the active edit target in the user interface. This is the same as checking the state of the radio button next to the occurrence in the browser. To activate the occurrence use the Activate method.
isConfiguration PreviewReturns if this occurrence represents a configuration or not.
isGrounded Gets and sets whether this occurrence is grounded or not.
isIsolated Gets and sets whether this occurrence is isolated in the UI. When an occurrence is isolated it is the only one visible in the user-interface. Only one occurrence can be isolated at a time so setting this property to true will un-isolate an occurrence that is currently isolated. Setting this property to false for an occurrence that is current isolated will un-isolate it so that no occurrence will be isolated.
isLightBulbOn Gets and sets if the light bulb of this occurrence as displayed in the browser is on or off. An occurrence will only be visible if the light bulb is switched on. However, the light bulb can be on and the occurrence still invisible if a higher level occurrence in the assembly context is not visible because its light bulb is off.
isReferencedComponent Gets if this occurrence is referencing an external component.
isSelectable Gets and sets whether this occurrence is selectable or not.
isValid Indicates if this object is still valid, i.e. hasn't been deleted or some other action done to invalidate the reference.
isVisible Gets whether the occurrence is visible. This property is affected by the assembly context.
joints Returns the joints that affect the position of this occurrence. For example, if a joint has been created between this occurrence and another occurrence, this property will return that joint. If the occurrence is a proxy, the joints returned will also be proxies in the same context as the occurrence.
name The name of the occurrence. This is the name as seen in the browser. It is a reflection of the component name with an added counter suffix (i.e. 'OccurrenceName:1').
nativeObject The NativeObject is the object outside the context of an assembly. Returns null in the case where this object is not in the context of an assembly but is already the native object. The return type is strongly typed for each object.
objectType This property is supported by all objects in the API and returns a string that contains the full name (namespace::objecttype) describing the type of the object.

It's often useful to use this in combination with the classType method to see if an object is a certain type. For example: if obj.objectType == adsk.core.Point3D.classType():
orientedMinimumBoundingBox PreviewReturns an oriented bounding box that is best oriented to tightly fit all B-Rep bodies in the occurrence. All other geometry types are ignored.
physicalProperties Returns the PhysicalProperties object that has properties for getting the area, density, mass, volume, moments, etc of this occurrence. Property values will be calculated using the 'LowCalculationAccuracy' setting when using this property to get the PhysicalProperties object. To specify a higher calculation tolerance, use the getPhysicalProperties method instead.
preciseBoundingBox PreviewReturns a bounding box that tightly fits around all B-Rep bodies in the occurrence. All other geometry types are ignored.
rigidGroups Returns the rigid groups that this occurrence is a member of. If the occurrence is a proxy, the joints returned will also be proxies in the same context as the occurrence.
sourceComponent This is the sourceComponent for the occurrence and is affected by the assembly context. This is the top-level component where the path begins.
timelineObject Returns the timeline object associated with the creation of this occurrence.
transform **RETIRED** Gets and sets the 3d matrix data that defines this occurrences orientation and position in its assembly context
transform2 Gets and sets the 3d matrix data that defines this occurrences orientation and position in its assembly context
visibleOpacity The user can set an override opacity for components and these opacity overrides combine if children and parent components have overrides. This property returns the actual opacity that is being used to render the occurrence. To set the opacity use the opacity property of the Component object.

Accessed From

AsBuiltJoint.assemblyContext, AsBuiltJoint.occurrenceOne, AsBuiltJoint.occurrenceTwo, AsBuiltJointInput.occurrenceOne, AsBuiltJointInput.occurrenceTwo, BaseFeature.assemblyContext, BossFeature.assemblyContext, BossFeatureInput.creationOccurrence, BoundaryFillFeature.assemblyContext, BoundaryFillFeatureInput.creationOccurrence, BoxFeature.assemblyContext, BRepBody.assemblyContext, BRepCoEdge.assemblyContext, BRepEdge.assemblyContext, BRepFace.assemblyContext, BRepLoop.assemblyContext, BRepLump.assemblyContext, BRepShell.assemblyContext, BRepVertex.assemblyContext, BRepWire.assemblyContext, CAM.designRootOccurrence, Canvas.assemblyContext, ChamferFeature.assemblyContext, CircularPatternConstraint.assemblyContext, CircularPatternFeature.assemblyContext, CoilFeature.assemblyContext, CoincidentConstraint.assemblyContext, CoincidentToSurfaceConstraint.assemblyContext, CollinearConstraint.assemblyContext, CombineFeature.assemblyContext, ConcentricConstraint.assemblyContext, ConfigurationInsertColumn.occurrence, ConstructionAxis.assemblyContext, ConstructionAxisInput.creationOccurrence, ConstructionPlane.assemblyContext, ConstructionPlaneInput.creationOccurrence, ConstructionPoint.assemblyContext, ConstructionPointInput.creationOccurrence, CopyPasteBody.assemblyContext, CustomFeature.assemblyContext, CutPasteBody.assemblyContext, CylinderFeature.assemblyContext, DeleteFaceFeature.assemblyContext, Design.activeOccurrence, DraftFeature.assemblyContext, EqualConstraint.assemblyContext, ExtendFeature.assemblyContext, ExtrudeFeature.assemblyContext, ExtrudeFeatureInput.creationOccurrence, Feature.assemblyContext, FilletFeature.assemblyContext, FlangeFeature.assemblyContext, FlatPattern.assemblyContext, FlatPatternProduct.activeOccurrence, FormFeature.assemblyContext, GeometricConstraint.assemblyContext, HoleFeature.assemblyContext, HoleFeatureInput.creationOccurrence, HorizontalConstraint.assemblyContext, HorizontalPointsConstraint.assemblyContext, Joint.assemblyContext, Joint.occurrenceOne, Joint.occurrenceTwo, JointOrigin.assemblyContext, LineOnPlanarSurfaceConstraint.assemblyContext, LineParallelToPlanarSurfaceConstraint.assemblyContext, LoftFeature.assemblyContext, LoftFeatureInput.creationOccurrence, ManufacturingModel.occurrence, MeshBody.assemblyContext, MeshFeature.assemblyContext, MeshReduceFeature.assemblyContext, MeshRemeshFeature.assemblyContext, MeshRepairFeature.assemblyContext, MeshShellFeature.assemblyContext, MeshSmoothFeature.assemblyContext, MidPointConstraint.assemblyContext, MirrorFeature.assemblyContext, MoveFeature.assemblyContext, Occurrence.assemblyContext, Occurrence.createForAssemblyContext, Occurrence.moveToComponent, Occurrence.nativeObject, OccurrenceList.item, OccurrenceList.itemByName, Occurrences.addByInsert, Occurrences.addExistingComponent, Occurrences.addFromConfiguration, Occurrences.addNewComponent, Occurrences.addNewComponentCopy, Occurrences.asArray, Occurrences.item, Occurrences.itemByName, OffsetConstraint.assemblyContext, OffsetFacesFeature.assemblyContext, OffsetFeature.assemblyContext, ParallelConstraint.assemblyContext, PatchFeature.assemblyContext, PatchFeatureInput.creationOccurrence, Path.assemblyContext, PathEntity.assemblyContext, PathPatternFeature.assemblyContext, PatternElement.occurrences, PerpendicularConstraint.assemblyContext, PerpendicularToSurfaceConstraint.assemblyContext, PipeFeature.assemblyContext, PipeFeatureInput.creationOccurrence, PolygonConstraint.assemblyContext, Profile.assemblyContext, ProfileCurve.assemblyContext, ProfileLoop.assemblyContext, RectangularPatternConstraint.assemblyContext, RectangularPatternFeature.assemblyContext, RefoldFeature.assemblyContext, RemoveFeature.assemblyContext, ReplaceFaceFeature.assemblyContext, ReverseNormalFeature.assemblyContext, RevolveFeature.assemblyContext, RevolveFeatureInput.creationOccurrence, RibFeature.assemblyContext, RigidGroup.assemblyContext, RipFeature.assemblyContext, RuledSurfaceFeature.assemblyContext, RuledSurfaceFeatureInput.creationOccurrence, RuleFilletFeature.assemblyContext, ScaleFeature.assemblyContext, ShellFeature.assemblyContext, ShellFeatureInput.creationOccurrence, SilhouetteSplitFeature.assemblyContext, Sketch.assemblyContext, SketchAngularDimension.assemblyContext, SketchArc.assemblyContext, SketchCircle.assemblyContext, SketchConcentricCircleDimension.assemblyContext, SketchConicCurve.assemblyContext, SketchControlPointSpline.assemblyContext, SketchCurve.assemblyContext, SketchDiameterDimension.assemblyContext, SketchDimension.assemblyContext, SketchDistanceBetweenLineAndPlanarSurfaceDimension.assemblyContext, SketchDistanceBetweenPointAndSurfaceDimension.assemblyContext, SketchEllipse.assemblyContext, SketchEllipseMajorRadiusDimension.assemblyContext, SketchEllipseMinorRadiusDimension.assemblyContext, SketchEllipticalArc.assemblyContext, SketchEntity.assemblyContext, SketchFittedSpline.assemblyContext, SketchFixedSpline.assemblyContext, SketchLine.assemblyContext, SketchLinearDiameterDimension.assemblyContext, SketchLinearDimension.assemblyContext, SketchOffsetCurvesDimension.assemblyContext, SketchOffsetDimension.assemblyContext, SketchPoint.assemblyContext, SketchRadialDimension.assemblyContext, SketchTangentDistanceDimension.assemblyContext, SketchText.assemblyContext, SmoothConstraint.assemblyContext, SphereFeature.assemblyContext, SplitBodyFeature.assemblyContext, SplitFaceFeature.assemblyContext, StitchFeature.assemblyContext, SurfaceDeleteFaceFeature.assemblyContext, SweepFeature.assemblyContext, SweepFeatureInput.creationOccurrence, SymmetryConstraint.assemblyContext, TangentConstraint.assemblyContext, TangentRelationship.assemblyContext, TangentRelationship.occurrenceOne, TangentRelationship.occurrenceTwo, ThickenFeature.assemblyContext, ThickenFeatureInput.creationOccurrence, ThreadFeature.assemblyContext, TorusFeature.assemblyContext, TrimFeature.assemblyContext, UnfoldFeature.assemblyContext, UnstitchFeature.assemblyContext, UntrimFeature.assemblyContext, VerticalConstraint.assemblyContext, VerticalPointsConstraint.assemblyContext, WebFeature.assemblyContext, WorkingModel.activeOccurrence

Samples

Name Description
Get Volume of Active Design API Sample Traverses through the active design and totals the volume of every body within the design.

Version

Introduced in version August 2014