Parameter Object

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

Description

The base class Parameter object that can represent model or user parameters.

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().

Properties

Name Description
attributes Returns the collection of attributes associated with this face.
comment The comment associated with this parameter
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 (i.e. "22.064 mm") used to calculate the value of the parameter
isDeletable Gets if this parameter can be deleted. Parameters that cannot be deleted are: Model Parameters and User Parameters that have dependents.
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.
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():
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

Accessed From

ConfigurationParameterColumn.parameter, ConstructionPlaneAtAngleDefinition.angle, ConstructionPlaneDistanceOnPathDefinition.distance, ConstructionPlaneOffsetDefinition.offset, ConstructionPlaneTangentDefinition.angle, ParameterList.item, ParameterList.itemByName

Derived Classes

ModelParameter, UserParameter

Samples

Name Description
Create Animation API Sample Creates a series of images of a design where a parameter is being changed. The series of images can be used to create an animation using other software. To run this sample, have a part open that contains a parameter named "Length". The parameter should be able to be successfully modified from 10 to 15 centimeters. Run the sample and choose or create a directory for the output. After running you should have a folder full of images that are snapshots of each parameter value.
Set parameters from a csv file and export to STEP Reads data from a .csv file and sets user parameters in the model and then exports the model to STEP. When setting parameters be aware that this sample is setting user parameters. It's also possible to set model parameters but that's not demonstrated here. Also when accessing parameters, it is case sensitive so the names you use in your program much exactly match the names in the model.

Version

Introduced in version August 2014