Revit API 移动元素

简介: Revit API 移动元素

1、Using Location

ElementId ElementId = new ElementId(470604);
Element Element = doc.GetElement(ElementId);
LocationPoint location = Element.Location as LocationPoint;
XYZ newlocation = new XYZ(location.Point.X+10, location.Point.Y, location.Point.Z);
location.Point = newlocation;

MOVE后加偏移量!

ElementId ElementId = new ElementId(470604);
Element Element = doc.GetElement(ElementId);
LocationPoint location = Element.Location as LocationPoint;
XYZ newlocation1 = new XYZ(10,0,0);
location.Move(newlocation1);

参考文献:http://help.autodesk.com/view/RVT/2014/ENU/?guid=GUID-CD3B9A83-8DBC-418E-8099-D655AB3DA010  

public void MoveColumn(Autodesk.Revit.DB.Document document, FamilyInstance column)
{
        // get the column current location
        LocationPoint columnLocation = column.Location as LocationPoint;
        XYZ oldPlace = columnLocation.Point;
        // Move the column to new location.
        XYZ newPlace = new XYZ(10, 20, 30);
        ElementTransformUtils.MoveElement(document, column.Id, newPlace);
        // now get the column's new location
        columnLocation = column.Location as LocationPoint;
        XYZ newActual = columnLocation.Point;
        string info = "Original Z location: " + oldPlace.Z + 
                        "\nNew Z location: " + newActual.Z;
        TaskDialog.Show("Revit",info);
}
相关文章
|
测试技术 API Windows
使用钩子(Hook)实现Revit API中 PickObjects 完成按钮的触发
使用钩子(Hook)实现Revit API中 PickObjects 完成按钮的触发
使用钩子(Hook)实现Revit API中 PickObjects 完成按钮的触发
|
JSON API PHP
化学元素信息,元素周期表查询免费API完整指南
本接口提供权威化学元素的100+项参数查询服务,涵盖原子结构、物理性质、分布数据等科研级参数。支持中文名称、元素符号(区分大小写)或原子序数查询,适用于教育软件、化学工具和科研系统开发。数据版权归属接口盒子。
386 0
快速设置Revit模型材质(Dynamo和API)
快速设置Revit模型材质(Dynamo和API)
快速设置Revit模型材质(Dynamo和API)
Revit功能与其API功能的对比
Revit功能与其API功能的对比
Revit功能与其API功能的对比
Revit API中可设置的面板控件
Revit API中可设置的面板控件
Revit API中可设置的面板控件
Revit API获取链接模型状态
Revit API获取链接模型状态
Revit API 不能直接隐藏(Hide)Group?另有它法!
Revit API 不能直接隐藏(Hide)Group?另有它法!
Revit API 修改视觉样式(Visual Style)
Revit API 修改视觉样式(Visual Style)
|
缓存 监控 前端开发
顺企网 API 开发实战:搜索 / 详情接口从 0 到 1 落地(附 Elasticsearch 优化 + 错误速查)
企业API开发常陷参数、缓存、错误处理三大坑?本指南拆解顺企网双接口全流程,涵盖搜索优化、签名验证、限流应对,附可复用代码与错误速查表,助你2小时高效搞定开发,提升响应速度与稳定性。
|
数据可视化 测试技术 API
从接口性能到稳定性:这些API调试工具,让你的开发过程事半功倍
在软件开发中,接口调试与测试对接口性能、稳定性、准确性及团队协作至关重要。随着开发节奏加快,传统方式已难满足需求,专业API工具成为首选。本文介绍了Apifox、Postman、YApi、SoapUI、JMeter、Swagger等主流工具,对比其功能与适用场景,并推荐Apifox作为集成度高、支持中文、可视化强的一体化解决方案,助力提升API开发与测试效率。

热门文章

最新文章