RebarShapeDefinitionBySegments.AddConstraintToSegment
Method
Description:
Add a constraint that helps determine the length of a segment.
Add a constraint that helps determine the length of a segment.
Remarks:
The vector defined by (constraintDirCoordX, constraintDirCoordY) must have a positive dot product with the desired direction of the segment. This restriction, combined with the value of signOfZCoordOfCrossProductOfConstraintDirBySegmentDir, defines a quadrant of the plane that limits the variable-angle segment.
The vector defined by (constraintDirCoordX, constraintDirCoordY) must have a positive dot product with the desired direction of the segment. This restriction, combined with the value of signOfZCoordOfCrossProductOfConstraintDirBySegmentDir, defines a quadrant of the plane that limits the variable-angle segment.
Syntax
Parameters
Parameter | Type | Description |
---|---|---|
iSegment | Int32 | Index of the segment (0 to NumberOfSegments - 1). |
paramId | ElementId | Id of a parameter to drive the constraint. To obtain the id of a shared parameter, call RebarShape.GetElementIdForExternalDefinition(). |
constraintDirCoordX | Double | The x-coordinate of a 2D vector specifying the constraint direction. |
constraintDirCoordY | Double | The y-coordinate of a 2D vector specifying the constraint direction. |
signOfZCoordOfCrossProductOfConstraintDirBySegmentDir | Int32 | Legal values are 1 and -1. For a fixed-direction segment, this value is ignored. For a variable-direction segment, this value is combined with the constraint length (the nonnegative value associated with 'param') to determine the direction of the segment. For example, a segment whose direction vector lies in the upper-right quadrant of the plane, and whose x-axis projected length is A and whose y-axis projected length is B, could be created by calling: AddConstraintToSegment(iSegment, paramA, 1.0, 0.0, 1, ...) AddConstraintToSegment(iSegment, paramB, 0.0, 1.0, -1, ...) |
measureToOutsideOfBend0 | Boolean | Choose between two possibilities for the first reference of the length dimension. If false, the reference is at the point where the bend begins; equivalently, at the projection of the bend centerpoint onto the segment. If true, the reference is moved outward by a distance equal to the bend radius plus the bar diameter; if the bend is a right angle or greater, this is equivalent to putting the reference at the outer face of the bend. |
measureToOutsideOfBend1 | Boolean | Choose between two possibilities for the second reference of the length dimension. |
Return Value
Exceptions
Exception | Condition |
---|---|
ArgumentException | iSegment is not between 0 and NumberOfSegments. -or- paramId is not the id of a shared parameter in the current document, or its unit type is not UT_Reinforcement_Length or UT_Angle. -or- The length of the vector (constraintDirCoordX, constraintDirCoordY) is too close to zero. -or- signOfZCoordOfCrossProductOfConstraintDirBySegmentDir is neither -1 nor 1. |
ArgumentNullException | A non-optional argument was null |