这个例子介绍体量族的修改。包含了创建体量,用API 移动体量族的顶点、边、轮廓(面)。
效果分步骤展示。
整理:
m_revitDoc.FamilyCreate.NewLoftForm(true, profiles)
form.AddProfile(connectingEdge.Reference, param)
form.get_CurveLoopReferencesOnProfile(profileIndex, 0);, form.GetGeometryObjectFromReference(r)
get_CurveLoopReferencesOnProfile
返回的引用form.MoveProfile(profileIndex, offset);
form.MoveSubElement(subElemReference, offset);
form.AddEdge(topEdge.Reference, topParam, bottomEdge.Reference, bottomParam);
MoveSubElement(form, edgeReference, offset);
form.get_CurveLoopReferencesOnProfile(profileIndex, 0);, form.GetGeometryObjectFromReference(r)
get_CurveLoopReferencesOnProfile
返回的引用这个例子,本质上是对 Form API 的一个应用。参考 API 接口做一下总结:
// class Autodesk.Revit.DB.Form
// 1. 增加边和轮廓
public void AddEdge(Reference faceReference, XYZ point);
public void AddEdge(Reference startEdgeReference, double startParam, Reference endEdgeReference, double endParam);
public void AddEdge(Reference startPointReference, Reference endPointReference);
public int AddProfile(Reference edgeReference, double param);
// 2. 移动
public void MoveProfile(int profileIndex, XYZ offset);
public void MoveSubElement(Reference subElementReference, XYZ offset);
// 3. 旋转
public void RotateProfile(int profileIndex, Line axis, double angle);
public void RotateSubElement(Reference subElementReference, Line axis, double angle);
// 4. 缩放
public void ScaleProfile(int profileIndex, double factor, XYZ origin);
public void ScaleSubElement(Reference subElementReference, double factor, XYZ origin);
// 5. 查询
public ReferenceArray GetControlPoints(Reference curveOrEdgeOrFaceReference);
public ReferenceArray GetCurvesAndEdgesReference(Reference pointReference);```