ObjectCollection Object

Derived from: Base Object
Defined in namespace "adsk::core" and the header file is <Core/Application/ObjectCollection.h>

Description

Generic collection used to handle lists of any object type.

Methods

Name Description
add Adds an object to the end of the collection. Duplicates can be added to the collection.
asArray Returns the content of the ObjectCollection as an array.
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().
clear Clears the entire contents of the collection.
contains Returns whether the specified object exists within the collection.
create Creates a new ObjectCollection object.
createWithArray Creates a new ObjectCollection that is initialized with the content of the provided array.
find Finds the specified component in the collection.
item Function that returns the specified object using an index into the collection.
removeByIndex Function that removes an item from the list. Will fail if the list is read only.
removeByItem Function that removes an item from the collection.

Properties

Name Description
count Returns the number of occurrences in the collection.
isValid Indicates if this object is still valid, i.e. hasn't been deleted or some other action done to invalidate the reference.
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():

Accessed From

Appearance.usedBy, Attribute.otherParents, BaseComponent.findBRepUsingPoint, BaseComponent.findBRepUsingRay, BoundaryFillFeature.tools, BoundaryFillFeatureInput.tools, BRepCell.sourceTools, BRepEdge.tangentiallyConnectedEdges, CAM.allOperations, CAMFolder.allOperations, CAMFolder.createFromTemplate, CAMPattern.allOperations, CAMPattern.createFromTemplate, ChamferFeature.edges, ChamferFeatureInput.edges, ChordLengthFilletEdgeSet.edges, ChordLengthFilletEdgeSetInput.entities, CircularPatternFeature.inputEntities, CircularPatternFeature.resultFeatures, CircularPatternFeatureInput.inputEntities, CombineFeature.toolBodies, CombineFeatureInput.toolBodies, Component.findBRepUsingPoint, Component.findBRepUsingRay, ConstantRadiusFilletEdgeSet.edges, ConstantRadiusFilletEdgeSetInput.entities, CopyPasteBody.sourceBody, CutPasteBody.sourceBody, DistanceAndAngleChamferEdgeSet.edges, DXF2DImportOptions.results, EqualDistanceChamferEdgeSet.edges, ExtendFeature.edges, ExtendFeatureInput.edges, FilletEdgeSetInput.entities, FlatPatternComponent.findBRepUsingPoint, FlatPatternComponent.findBRepUsingRay, ImportManager.importToTarget2, InfiniteLine3D.intersectWithCurve, InfiniteLine3D.intersectWithSurface, InterferenceInput.entities, InterferenceResults.createBodies, Line3D.intersectWithCurve, Line3D.intersectWithSurface, MirrorFeature.inputEntities, MirrorFeature.resultFeatures, MirrorFeatureInput.inputEntities, MoveFeature.inputEntities, MoveFeatureInput.inputEntities, ObjectCollection.create, ObjectCollection.createWithArray, OffsetFeature.entities, OffsetFeatureInput.entities, PatchFeature.interiorRailsAndPoints, PatchFeatureInput.interiorRailsAndPoints, PathPatternFeature.inputEntities, PathPatternFeature.resultFeatures, PathPatternFeatureInput.inputEntities, Plane.intersectWithCurve, Plane.intersectWithSurface, RectangularPatternFeature.inputEntities, RectangularPatternFeature.resultFeatures, RectangularPatternFeatureInput.inputEntities, ReplaceFaceFeatureInput.sourceFaces, ReverseNormalFeature.surfaces, ScaleFeature.inputEntities, ScaleFeatureInput.inputEntities, SelectionEventArgs.additionalEntities, Selections.all, Setup.allOperations, Setup.createFromTemplate, Setup.fixtures, Setup.models, Setup.stockSolids, ShellFeature.inputEntities, ShellFeatureInput.inputEntities, Sketch.copy, Sketch.findConnectedCurves, Sketch.include, Sketch.offset, Sketch.project, Sketch.projectCutEdges, SketchArc.breakCurve, SketchArc.extend, SketchArc.intersections, SketchArc.split, SketchArc.trim, SketchCircle.breakCurve, SketchCircle.extend, SketchCircle.intersections, SketchCircle.split, SketchCircle.trim, SketchConicCurve.breakCurve, SketchConicCurve.extend, SketchConicCurve.intersections, SketchConicCurve.split, SketchConicCurve.trim, SketchControlPointSpline.breakCurve, SketchControlPointSpline.extend, SketchControlPointSpline.intersections, SketchControlPointSpline.split, SketchControlPointSpline.trim, SketchCurve.breakCurve, SketchCurve.extend, SketchCurve.intersections, SketchCurve.split, SketchCurve.trim, SketchEllipse.breakCurve, SketchEllipse.extend, SketchEllipse.intersections, SketchEllipse.split, SketchEllipse.trim, SketchEllipticalArc.breakCurve, SketchEllipticalArc.extend, SketchEllipticalArc.intersections, SketchEllipticalArc.split, SketchEllipticalArc.trim, SketchFittedSpline.breakCurve, SketchFittedSpline.extend, SketchFittedSpline.intersections, SketchFittedSpline.split, SketchFittedSpline.trim, SketchFixedSpline.breakCurve, SketchFixedSpline.extend, SketchFixedSpline.intersections, SketchFixedSpline.split, SketchFixedSpline.trim, SketchLine.breakCurve, SketchLine.extend, SketchLine.intersections, SketchLine.split, SketchLine.trim, SketchPointsBossPositionDefinition.sketchPoints, SketchPointsHolePositionDefinition.sketchPoints, SplitBodyFeature.splitBodies, SplitFaceFeature.facesToSplit, SplitFaceFeature.splittingTool, SplitFaceFeatureInput.facesToSplit, StitchFeature.stitchSurfaces, StitchFeatureInput.stitchSurfaces, SurfaceEvaluator.getIsoCurve, SurfaceEvaluator.getModelCurveFromParametricCurve, ThickenFeature.inputFaces, ThickenFeatureInput.inputFaces, ThreadFeature.inputCylindricalFaces, ThreadFeatureInput.inputCylindricalFaces, ToolbarPanel.relatedWorkspaces, TwoDistancesChamferEdgeSet.edges, UnstitchFeature.inputFaces, VariableRadiusFilletEdgeSet.edges, VariableRadiusFilletEdgeSetInput.entities

Samples

Name Description
SketchFittedSplines.add Demonstrates the SketchFittedSplines.add method.

Version

Introduced in version August 2014