该类提供了对馈线自由形式对象的访问和控制,以便在Revit结构模型中创建和编辑重新加强。RebarFreeFormAccessor类允许访问和操作馈线自由形式对象的细节,包括其形状,位置,旋转角度和约束条件。
该类的构造函数不公开,在其他API中使用其他函数来创建RebarFreeFormAccessor对象。
以下示例演示如何使用RebarFreeFormAccessor类创建具有基于形状和承载体约束条件的馈线自由形式对象:
// Create a new free-form rebar object
RebarFreeFormAccessor newRebar = RebarFreeFormAccessor.CreateFreeForm(doc);
// Set the rebar shape
RebarShape newShape = RebarShape.FromTrapezoidalBarSpacing(0.0625, 0.75, 10, 24);
newRebar.SetRebarShape(newShape);
// Set host-driven constraints
Reference hostRef = someHostElement.Reference;
Curve hostCurve = someCurve;
RebarConstraints hostConstraints = new HostRebarConstraints(hostRef, hostCurve, false,
RebarConstraintType.StartSetback, RebarConstraintType.EndSetback);
newRebar.SetHostDrivenConstraint(hostConstraints);
// Set shape-driven constraints
double shapeConstraintValue = 6.0;
RebarConstraints shapeConstraints = new ShapeDrivenRebarConstraints(shapeConstraintValue,
RebarConstraintType.StartSpacing, RebarConstraintType.EndSpacing);
newRebar.SetShapeDrivenConstraint(shapeConstraints);