revit java 接口_如何使用Revit API获取axis属性?

我试图使用Revit Interactive Python Shell在Revit中旋转对象 . 我挂了如何指定旋转轴 . 我不知道如何使用API创建一行,然后在ElementTransformUtils.RotateElement()中指定一个轴

RotateElement()中的第三个参数是轴 . 我正在创建一条线,但我不确定我是否在.RotateElement()的第三个参数中指定了它的轴

当我运行此代码时没有任何反应 . 如果我选择了墙,情况就是如此 . 如果有任何需要澄清,请告诉我 .

谢谢,

import clr

import math

clr.AddReference('RevitAPI')

clr.AddReference('RevitAPIUI')

from Autodesk.Revit.DB import *

def pickobject():

from Autodesk.Revit.UI.Selection import ObjectType

__window__.Hide()

picked = uidoc.Selection.PickObject(ObjectType.Element)

__window__.Show()

__window__.Topmost = True

return picked

#set the active Revit application and document

app = __revit__.Application

doc = __revit__.ActiveUIDocument.Document

#define a transaction variable and describe the transaction

t = Transaction(doc, 'This is my new transaction')

#start a transaction in the Revit database

t.Start()

#perform some action here...

el = pickobject()

p1 = XYZ(0,0,0)

p2 = XYZ(0,0,1)

myLine = Line.CreateBound(p1, p2)

ElementTransformUtils.RotateElement(doc, el.ElementId, myLine, math.pi / 2)

#commit the transaction to the Revit database

t.Commit()

#close the script window

__window__.Close()

事实证明我没有正确选择元素或将度数转换为弧度 . 做完这些事后,我能够使我选择的元素旋转90度 . 我现在面临的唯一问题是选择元素旋转的原点 .

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值