ModelParameter Object

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

Description

Represents a Model Parameter.

Methods

Name Description
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().
deleteMe Deletes this ModelParameter. As a general rule, model parameters cannot be deleted because features depend on them. However, there are uncommon workflows where a parameter no longer has any dependents and is not automatically deleted. You can use the isDeletable property to see if the parameter is in this state and can successfully be deleted.

Properties

Name Description
attributes Returns the collection of attributes associated with this face.
comment The comment associated with this parameter
component Returns the Component containing the ModelParameter.
createdBy Returns the object that created this parameter. For example, a feature, a sketch dimension, or a construction plane.
dependencyParameters Returns a list of parameters that this parameter is dependent on.
dependentParameters Returns a list of parameters that are dependent on this parameter as a result of this parameter being referenced in their equation.
entityToken Returns a token for the Parameter object. This can be saved and used at a later time with the Design.findEntityByToken method to get back the same parameter.

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.
expression Gets and sets the expression used to calculate the value of the parameter. This is the equivalent of the "Expression" column in the Parameters dialog. Numeric parameters can be defined by a simple expression like "6.25", which will be interpreted based on whatever the default units are for the document. For example, if the units are set to millimeters, the value will be 6.25 mm; if the units are inches, it will be 6.25 inches. The expression can also contain the units so "6.25 in" will always be evaluated as inches regardless of the document units.

An expression can also contain references to other parameters and use equations. For example, the expression "Length / 2" is valid for a numeric parameter as long as there is a numeric parameter named "Length". Expressions can also be used for text parameters, such as concatenating two other text parameters. For example, if there are two existing text parameters named text1 and text2, the expression for another text parameter can be "text1 + text2". More complex equations can also be used with text parameters like "if (Length < 20 mm; 'Short'; 'Long')" where "Length" is a numeric parameter. The resulting string can be obtained using the textValue property.
isDeletable Gets if this parameter can be deleted. Parameters that have dependents cannot be deleted, and model parameters typically cannot be deleted. However, there is the possibility in uncommon workflows where a model parameter no longer has any dependents, and it was not automatically deleted. In this case, this property will return true, and the deleteMe method can delete the parameter.
isFavorite Gets and sets whether this parameter is included in the Favorites list in the parameters dialog
isValid Indicates if this object is still valid, i.e. hasn't been deleted or some other action done to invalidate the reference.
modelParameters Returns the Collection containing the ModelParameter.
name Gets and sets the name of the parameter. Setting the name can fail if the name is not unique with respect to all other parameters in the design.
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():
role This property identifies what the parameter is used for. For an extrude, it could be "Depth", for a work plane it could be "Offset".
textValue PreviewGets and sets the value of the parameter when it is a text parameter. This can be determined by checking the valueType property. Setting this value will cause the current expression to be overwritten. If the parameter is not a text parameter, the value of this property should be ignored and setting will fail.
unit The unit type associated with this parameter. An empty string is returned for parameters that don't have a unit type.
value Gets and sets the real value (a double) of the parameter in database units. Setting this property will set/reset the expression value for this parameter.

This property is only valid for numeric parameters and will fail for text parameters. You can determine the value type of the parameter by using the valueType property. Use the textValue property to get and set the value of text parameters.
valueType PreviewReturns the type of value this parameter is. For a numeric parameter, you can get the value using the value property. For a text parameter, you can get the value using the textValue property.

Accessed From

AlongEdgeRipFeatureDefinition.gapDistance, AngleExtentDefinition.angle, Arrange2DDefinition.globalQuantity, Arrange2DDefinition.grainDirection, Arrange3DEnvelopeDefinition.ceilingClearance, Arrange3DEnvelopeDefinition.frameWidth, Arrange3DEnvelopeDefinition.height, Arrange3DEnvelopeDefinition.length, Arrange3DEnvelopeDefinition.objectSpacing, Arrange3DEnvelopeDefinition.originXOffset, Arrange3DEnvelopeDefinition.originYOffset, Arrange3DEnvelopeDefinition.placementClearance, Arrange3DEnvelopeDefinition.width, ArrangeEnvelopeDefinition.frameWidth, ArrangeEnvelopeDefinition.objectSpacing, ArrangeEnvelopeDefinition.placementClearance, ArrangePlaneEnvelopeDefinition.envelopeSpacing, ArrangePlaneEnvelopeDefinition.frameWidth, ArrangePlaneEnvelopeDefinition.length, ArrangePlaneEnvelopeDefinition.objectSpacing, ArrangePlaneEnvelopeDefinition.originXOffset, ArrangePlaneEnvelopeDefinition.originYOffset, ArrangePlaneEnvelopeDefinition.placementClearance, ArrangePlaneEnvelopeDefinition.quantity, ArrangePlaneEnvelopeDefinition.width, ArrangeProfileOrFaceEnvelopeDefinition.frameWidth, ArrangeProfileOrFaceEnvelopeDefinition.objectSpacing, ArrangeProfileOrFaceEnvelopeDefinition.placementClearance, BetweenPointsRipFeatureDefinition.gapDistance, BetweenPointsRipFeatureDefinition.pointOneOffset, BetweenPointsRipFeatureDefinition.pointTwoOffset, BossFeature.alignmentDepth, BossFeature.alignmentDiameter, BossFeature.alignmentDraftAngle, BossFeature.alignmentRootRadius, BossFeature.alignmentTipRadius, BossFeature.diameter, BossFeature.draftAngle, BossFeature.holeCountersinkAngle, BossFeature.holeDepth, BossFeature.holeDiameter, BossFeature.holeDraftAngle, BossFeature.holeEndRadius, BossFeature.holeMajorDepth, BossFeature.holeMajorDiameter, BossFeature.holeMajorDraftAngle, BossFeature.holeMajorRootRadius, BossFeature.holeMajorTipRadius, BossFeature.holeStartRadius, BossFeature.innerRadius, BossFeature.offset, BossFeature.offsetClearance, BossFeature.ribBlendRadius, BossFeature.ribChamferAngle, BossFeature.ribCount, BossFeature.ribCutSize, BossFeature.ribDraftAngle, BossFeature.ribLength, BossFeature.ribOffset, BossFeature.ribOuterDraftAngle, BossFeature.ribRotation, BossFeature.ribThickness, BossFeature.ribTipRadius, BossFeature.ribTotalAngle, BossFeature.rootRadius, BossFeature.screwDiameter, BossFeature.screwHeadAngle, BossFeature.screwHeadDiameter, BossFeature.taperAngle, BossFeature.thickness, BossFeature.tipRadius, ChordLengthFilletEdgeSet.chordLength, ChordLengthFilletEdgeSet.tangencyWeight, CircularPatternConstraint.quantity, CircularPatternConstraint.totalAngle, CircularPatternFeature.quantity, CircularPatternFeature.totalAngle, ConstantRadiusFilletEdgeSet.radius, ConstantRadiusFilletEdgeSet.tangencyWeight, DistanceAndAngleChamferEdgeSet.angle, DistanceAndAngleChamferEdgeSet.distance, DistanceAndAngleChamferTypeDefinition.angle, DistanceAndAngleChamferTypeDefinition.distance, DistanceExtentDefinition.distance, DoubleHemFeatureDefinition.gap, DoubleHemFeatureDefinition.length, DoubleHemFeatureDefinition.setback, EmbossFeature.depth, EmbossFeature.horizontalDistance, EmbossFeature.rotationAngle, EmbossFeature.verticalDistance, EqualDistanceChamferEdgeSet.distance, EqualDistanceChamferTypeDefinition.distance, ExtendFeature.distance, ExtrudeFeature.taperAngleOne, ExtrudeFeature.taperAngleTwo, ExtrudeFeature.thinExtrudeWallThicknessOne, ExtrudeFeature.thinExtrudeWallThicknessTwo, FilletEdgeSet.tangencyWeight, FlatHemFeatureDefinition.length, GeometricRelationship.offsetOrAngle, HoleFeature.counterboreDepth, HoleFeature.counterboreDiameter, HoleFeature.countersinkAngle, HoleFeature.countersinkDiameter, HoleFeature.holeDiameter, HoleFeature.tipAngle, Joint.angle, Joint.offset, Joint.offsetX, Joint.offsetY, JointOrigin.angle, JointOrigin.offsetX, JointOrigin.offsetY, JointOrigin.offsetZ, MeshConvertFeature.numberOfFaces, MeshGenerateFaceGroupsFeature.angleThreshold, MeshGenerateFaceGroupsFeature.boundaryTolerance, MeshGenerateFaceGroupsFeature.minimumFaceGroupSize, MeshReduceFeature.facecount, MeshReduceFeature.maximumDeviation, MeshReduceFeature.proportion, MeshRemeshFeature.density, MeshRemeshFeature.shapePreservation, MeshRepairFeature.density, MeshRepairFeature.offset, MeshShellFeature.thickness, MeshSmoothFeature.smoothness, MirrorFeature.stitchTolerance, ModelParameters.item, ModelParameters.itemByName, MoveFeaturePointToPositionDefinition.xDistance, MoveFeaturePointToPositionDefinition.yDistance, MoveFeaturePointToPositionDefinition.zDistance, MoveFeatureRotateDefinition.angle, MoveFeatureTranslateAlongEntityDefinition.distance, MoveFeatureTranslateXYZDefinition.xDistance, MoveFeatureTranslateXYZDefinition.yDistance, MoveFeatureTranslateXYZDefinition.zDistance, OffsetFeature.distance, OpenHemFeatureDefinition.gap, OpenHemFeatureDefinition.length, PathPatternFeature.distance, PathPatternFeature.quantity, PipeFeature.distanceOne, PipeFeature.distanceTwo, PipeFeature.sectionSize, PipeFeature.sectionThickness, PlaneAndOffsetsHolePositionDefinition.offsetOne, PlaneAndOffsetsHolePositionDefinition.offsetTwo, RectangularPatternConstraint.distanceOne, RectangularPatternConstraint.distanceTwo, RectangularPatternConstraint.quantityOne, RectangularPatternConstraint.quantityTwo, RectangularPatternFeature.distanceOne, RectangularPatternFeature.distanceTwo, RectangularPatternFeature.quantityOne, RectangularPatternFeature.quantityTwo, RolledHemFeatureDefinition.angle, RolledHemFeatureDefinition.radius, RopeHemFeatureDefinition.gap, RopeHemFeatureDefinition.length, RopeHemFeatureDefinition.radius, RuledSurfaceFeature.angle, RuledSurfaceFeature.distance, ScaleFeature.scaleFactor, ScaleFeature.xScale, ScaleFeature.yScale, ScaleFeature.zScale, ShellFeature.insideThickness, ShellFeature.outsideThickness, SketchAngularDimension.parameter, SketchConcentricCircleDimension.parameter, SketchDiameterDimension.parameter, SketchDimension.parameter, SketchDistanceBetweenLineAndPlanarSurfaceDimension.parameter, SketchDistanceBetweenPointAndSurfaceDimension.parameter, SketchEllipseMajorRadiusDimension.parameter, SketchEllipseMinorRadiusDimension.parameter, SketchLinearDiameterDimension.parameter, SketchLinearDimension.parameter, SketchOffsetCurvesDimension.parameter, SketchOffsetDimension.parameter, SketchRadialDimension.parameter, SketchTangentDistanceDimension.parameter, StitchFeature.tolerance, SweepFeature.distanceOne, SweepFeature.distanceTwo, SweepFeature.taperAngle, SweepFeature.twistAngle, TeardropHemFeatureDefinition.gap, TeardropHemFeatureDefinition.length, TeardropHemFeatureDefinition.radius, TessellateFeature.aspectRatio, TessellateFeature.maximumEdgeLength, TessellateFeature.normalDeviation, TessellateFeature.surfaceDeviation, ThickenFeature.thickness, ThreadFeature.threadLength, ThreadFeature.threadOffset, TwoDistancesChamferEdgeSet.distanceOne, TwoDistancesChamferEdgeSet.distanceTwo, TwoDistancesChamferTypeDefinition.distanceOne, TwoDistancesChamferTypeDefinition.distanceTwo, TwoSidesAngleExtentDefinition.angleOne, TwoSidesAngleExtentDefinition.angleTwo, TwoSidesDistanceExtentDefinition.distanceOne, TwoSidesDistanceExtentDefinition.distanceTwo, UntrimFeature.extensionDistance, VariableRadiusFilletEdgeSet.endRadius, VariableRadiusFilletEdgeSet.startRadius, VariableRadiusFilletEdgeSet.tangencyWeight, VolumetricModelToMeshFeature.elementSize, VolumetricModelToMeshFeature.smallShellThreshold

Derived Classes

CustomFeatureParameter

Version

Introduced in version August 2014