此类表示与钢筋形状相关的定长约束,用于使特定段的长度固定。这个类只适用于具有直线段的钢筋形状。
public RebarShapeConstraintFixedSegmentDir(int segmentIndex, XYZ direction)
segmentIndex
:必需。要设置为固定长度的线段的索引。direction
:必需。固定线段的方向。public XYZ Direction { get; }
Direction
:只读。固定线段的方向。public int SegmentIndex { get; }
SegmentIndex
:只读。线段的索引。RebarShapeDefinition
的AddConstraint
方法将此类的实例添加到RebarShapeDefinition
中,以指定形状约束。//创建RebarShapeDefinition
RebarShapeDefinition shapeDef = new RebarShapeDefinition(DefaultRebarShapeType.Generic);
//设置线段
IList<Curve> curves = new List<Curve>();
curves.Add(Line.CreateBound(new XYZ(0,0,0), new XYZ(10,0,0)));
curves.Add(Line.CreateBound(new XYZ(10,0,0), new XYZ(10,10,0)));
curves.Add(Line.CreateBound(new XYZ(10,10,0), new XYZ(0,10,0)));
curves.Add(Line.CreateBound(new XYZ(0,10,0), new XYZ(0,0,0)));
shapeDef.SetSegments(curves);
//添加定长约束
shapeDef.AddConstraint(new RebarShapeConstraintFixedSegmentDir(0, new XYZ(1,0,0)));
RebarShapeDefinition
RebarShapeConstraint
Curve