• “黑神话·悟空”免安装在线玩,无视显卡等硬件要求!!
  • √ 游戏免下载安装 √ 5分钟随开随玩 √ 关机不计费!低至¥14.90/月!
🔥进入竞技-直面天命🔥

写一个 Dynamo 放置 revit

时间2023-02-22 22:17:09 提问来自 广东省广州市 的网友 分类创作 浏览482
// Dynamo Script to Place Rebar in Revit // This script will place rebar in Revit using Dynamo // First, import the necessary libraries import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * clr.AddReference("RevitNodes") import Revit clr.ImportExtensions(Revit.Elements) // Create a new document and get the active view from it doc = DocumentManager.Instance.CurrentDBDocument view = doc.ActiveView // Get the current selection from the document and get its elements selection = revitDoc.Selection // Start a transaction to modify the document                                                                                                                                                                                                                                                                                                      transaction = New Transaction(doc, "Place Rebar")  transaction.Start()  try:   // Create a rebar type from parameters  rebarTypeParams = [RebarBarTypeParameters("Rebar Type", RebarStyle .Standard)]  rebarTypeName = "My Rebar Type"  rebarTypeCreated = doc .Create .NewRebarBarType(rebarTypeParams, rebarTypeName) // Create a new rebar set with parameters                                                                                                                                      setParams = [RebarSetParameters("Set Name", rebarTypeCreated)]  setName= "My Set"                  // Create an instance of the set in the active view setCreated= doc .Create .NewRebarSet(view, setParams, setName) // Place an instance of the set at given location locationPoint= XYZ (0, 0 ,0 ) instanceCreated= doc .Create .NewRebarInstanceAtPoint (view ,setCreated ,locationPoint ) // Commit changes to document transaction .Commit () except: transaction .RollBack ()

点击这里,进行内容创作

创作工场 免责声明:
以上内容除特别注明外均来源于网友提问,创作工场回答,未经许可,严谨转载。
点击这里>>使用🔥专业版,更聪明、更完整、更原创!

上一篇 他爱我吗 下一篇 函数割补法求面积伪代码