Revit API 移动元素
程序员文章站
2022-06-10 23:27:19
...
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);
}
上一篇: revit获取或设置参数
推荐阅读
-
Swiper.js实现移动端元素左右滑动
-
python里将list中元素依次向前移动一位
-
Web API---DOM---总结获取元素的方式
-
php数组函数序列之end() - 移动数组内部指针到最后一个元素,并返回该元素的值
-
php数组函数序列之prev() - 移动数组内部指针到上一个元素的位置,并返回该元素值
-
Web API---DOM---元素相关的操作方法
-
AI移动画布中的各种元素对象方法介绍
-
php数组函数序列之next() - 移动数组内部指针到下一个元素的位置,并返回该元素值
-
【Revit API】FamilyInstance、FamilySymbol、Family的寻找关系
-
webdriver的API与定位元素(2)