• Revit SDK 介绍:ManipulateForm 体量族的修改


    前言

    这个例子介绍体量族的修改。包含了创建体量,用API 移动体量族的顶点、边、轮廓(面)。

    内容

    效果分步骤展示。
    在这里插入图片描述
    整理:
    在这里插入图片描述

    核心逻辑

    1. 创建拉伸体 m_revitDoc.FamilyCreate.NewLoftForm(true, profiles)
    2. 增加一个截面 form.AddProfile(connectingEdge.Reference, param)
    3. 移动截面的边
      两个函数连用无法得到有有效的值 form.get_CurveLoopReferencesOnProfile(profileIndex, 0);, form.GetGeometryObjectFromReference(r)
      改为直接使用get_CurveLoopReferencesOnProfile返回的引用
    4. 移动截面 form.MoveProfile(profileIndex, offset);
    5. 移动底面的顶点 form.MoveSubElement(subElemReference, offset);
    6. 增加一条边 form.AddEdge(topEdge.Reference, topParam, bottomEdge.Reference, bottomParam);
    7. 移动边 MoveSubElement(form, edgeReference, offset);
    8. 移动增加边的顶点
      两个函数连用无法得到有有效的值 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);```
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
  • 相关阅读:
    【Spring Boot 集成应用】Spring Boot Admin的集成配置使用
    第1章 初识Spring Boot,开发社区首页(上)
    JSD-2204-单点登录-一系列小练习-Day16
    IOS 提取系统库
    simucpp系列教程(7)坟墓
    IDEA settings设置技巧,最常用快捷键,让你的编译器用更加得心应手
    Qt超时机制设计
    C语言:union类型
    call()、apply()、bind() 区别、使用场景、实现方式
    mysql使用FIND_IN_SET函数解决两张表没有主键id强关联,而是A表中的某个字段值,存在B表中的集合字段中
  • 原文地址:https://blog.csdn.net/weixin_44153630/article/details/132758223