ValueInput Object

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

Description

A ValueInput provides a flexible way of specifying a string, a double, a boolean, or object reference. No semantics are associated with a ValueInput (e.g. is the string valid, can the string be converted to a double) - it is merely a way of supplying information in either string, double, boolean or object reference form as a function parameter. ValueInput objects are typically used to specify things like an extrude depth, or hole diameter, etc.

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().
createByBoolean Creates a new ValueInput object that contains a boolean value.
createByObject Creates a new ValueInput object that contains a reference to any Fusion object.
createByReal Creates a new ValueInput object using a double. For example, if you create a value using the double value 2 and use it as input for a length, it will be interpreted as 2 cm because centimeters are the internal unit for length. Values defined by a real are always interpreted to be in the appropriate internal unit. For example, if the value 2 is used to define the depth of an extrusion (a length value), it will be 2 cm because cm is the internal unit for lengths. If the value 2 is used to define the angle of the extrude, it will be 2 radians because radians are the internal unit for angles.
createByString When a string is used to create a value it needs to be evaluated as an expression so its value can be determined using the UnitsManager class. The units of an expression can be explicitly defined or will default to the current default units. For example, if you create an expression with the string "6" and specify it as a length, it will use the current active units. If the current active units are defined as inches the expression will be interpreted as 6 inches. You can specify the units as part of the string (i.e. "6 mm"). You can also use equations in the string (i.e. "6 + 5mm")

In order for an expression to be valid, its units must be compatible with the value it represents. For example if you specify "5 in + 3 cm" as an expression to supply the value of an angle, it will fail because the units of the expression define a length.

Properties

Name Description
booleanValue Gets the boolean value, if there is one. Returns false AND GetLastError returns ValueNotOfType if there is no boolean value. You can use the valueType property to determine which value type is currently used.
isValid Indicates if this object is still valid, i.e. hasn't been deleted or some other action done to invalidate the reference.
objectReference Gets the object being referenced, if there is one. Returns null AND GetLastError returns ValueNotOfType if there is no object reference. You can use the valueType property to determine which value type is currently used.
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():
realValue Gets the real value, if there is one. Returns -1 AND GetLastError returns ValueNotOfType if there is no real value. You can use the valueType property to determine which value type is currently used.
stringValue Gets the string value, if there is one. Returns an empty string AND GetLastError returns ValueNotOfType if there is no string value. You can use the valueType property to determine which value type is currently used.
valueType Returns the type of value this ValueInput currently represents.

Accessed From

BossFeatureInput.offset, BossFeatureSideInput.alignmentDepth, BossFeatureSideInput.alignmentDiameter, BossFeatureSideInput.alignmentDraftAngle, BossFeatureSideInput.alignmentRootRadius, BossFeatureSideInput.alignmentTipRadius, BossFeatureSideInput.diameter, BossFeatureSideInput.draftAngle, BossFeatureSideInput.holeCountersinkAngle, BossFeatureSideInput.holeDepth, BossFeatureSideInput.holeDiameter, BossFeatureSideInput.holeDraftAngle, BossFeatureSideInput.holeEndRadius, BossFeatureSideInput.holeMajorDepth, BossFeatureSideInput.holeMajorDiameter, BossFeatureSideInput.holeMajorDraftAngle, BossFeatureSideInput.holeMajorRootRadius, BossFeatureSideInput.holeMajorTipRadius, BossFeatureSideInput.holeStartRadius, BossFeatureSideInput.offsetClearance, BossFeatureSideInput.ribChamferAngle, BossFeatureSideInput.ribCount, BossFeatureSideInput.ribCutSize, BossFeatureSideInput.ribDraftAngle, BossFeatureSideInput.ribLength, BossFeatureSideInput.ribOffset, BossFeatureSideInput.ribOuterDraftAngle, BossFeatureSideInput.ribRootRadius, BossFeatureSideInput.ribRotation, BossFeatureSideInput.ribThickness, BossFeatureSideInput.ribTipRadius, BossFeatureSideInput.ribTotalAngle, BossFeatureSideInput.rootRadius, BossFeatureSideInput.tipRadius, ChordLengthFilletEdgeSetInput.chordLength, ChordLengthFilletEdgeSetInput.tangencyWeight, CircularPatternConstraintInput.quantity, CircularPatternConstraintInput.totalAngle, CircularPatternFeatureInput.quantity, CircularPatternFeatureInput.totalAngle, CoilFeatureInput.angle, CoilFeatureInput.diameter, CoilFeatureInput.height, CoilFeatureInput.pitch, CoilFeatureInput.revolutions, CoilFeatureInput.sectionSize, ConstantRadiusFilletEdgeSetInput.radius, ConstantRadiusFilletEdgeSetInput.tangencyWeight, DraftFeatureInput.angleOne, DraftFeatureInput.angleTwo, ExtendFeatureInput.distance, ExtrudeFeatureInput.taperAngle, ExtrudeFeatureInput.taperAngleOne, ExtrudeFeatureInput.taperAngleTwo, ExtrudeFeatureInput.thinExtrudeWallThicknessOne, ExtrudeFeatureInput.thinExtrudeWallThicknessTwo, FilletEdgeSetInput.tangencyWeight, HoleFeatureInput.tipAngle, JointInput.angle, JointInput.offset, JointOriginInput.angle, JointOriginInput.offsetX, JointOriginInput.offsetY, JointOriginInput.offsetZ, MeshReduceFeatureInput.facecount, MeshReduceFeatureInput.maximumDeviation, MeshReduceFeatureInput.proportion, MeshRemeshFeatureInput.density, MeshRemeshFeatureInput.shapePreservation, MeshRepairFeatureInput.density, MeshRepairFeatureInput.offset, MeshShellFeatureInput.thickness, MeshSmoothFeatureInput.smoothness, MirrorFeatureInput.stitchTolerance, NamedValues.getByIndex, NamedValues.getValueByName, OffsetConstraintInput.offset, OffsetFeatureInput.distance, PathPatternFeatureInput.distance, PathPatternFeatureInput.quantity, PipeFeatureInput.distanceOne, PipeFeatureInput.distanceTwo, PipeFeatureInput.sectionSize, PipeFeatureInput.sectionThickness, RectangularPatternConstraintInput.distanceOne, RectangularPatternConstraintInput.distanceTwo, RectangularPatternConstraintInput.quantityOne, RectangularPatternConstraintInput.quantityTwo, RectangularPatternFeatureInput.distanceOne, RectangularPatternFeatureInput.distanceTwo, RectangularPatternFeatureInput.quantityOne, RectangularPatternFeatureInput.quantityTwo, RuledSurfaceFeatureInput.angle, RuledSurfaceFeatureInput.distance, ScaleFeatureInput.scaleFactor, ScaleFeatureInput.xScale, ScaleFeatureInput.yScale, ScaleFeatureInput.zScale, ShellFeatureInput.insideThickness, ShellFeatureInput.outsideThickness, StitchFeatureInput.tolerance, SweepFeatureInput.distanceOne, SweepFeatureInput.distanceTwo, SweepFeatureInput.taperAngle, SweepFeatureInput.twistAngle, ThickenFeatureInput.thickness, ThreadFeatureInput.threadLength, ThreadFeatureInput.threadOffset, UntrimFeatureInput.extensionDistance, ValueInput.createByBoolean, ValueInput.createByObject, ValueInput.createByReal, ValueInput.createByString, VariableRadiusFilletEdgeSetInput.endRadius, VariableRadiusFilletEdgeSetInput.startRadius, VariableRadiusFilletEdgeSetInput.tangencyWeight

Samples

Name Description
Loft Feature API Sample Demonstrates creating a new loft feature.
Patch Feature API Sample Demonstrates creating a new patch feature.
Simple Extrusion Sample Creates a new extrusion feature, resulting in a new component.
Simple Revolve Feature Sample Creates a new revolve feature, resulting in a new component.

Version

Introduced in version August 2014