zoukankan      html  css  js  c++  java
  • create a wall:Wall.Create(doc, line, baseLevel.Id, False)

    create a wall:

    import clr
    #Import module for Revit 
    clr.AddReference("RevitNodes")
    import Revit
    clr.ImportExtensions(Revit.Elements)
    #import module for the Document and transactions
    clr.AddReference("RevitServices")
    import RevitServices
    from RevitServices.Persistence import DocumentManager
    from RevitServices.Transactions import TransactionManager
    #import Revit API 
    clr.AddReference('RevitAPI')
    from Autodesk.Revit.DB import *
    #get the document 
    doc = DocumentManager.Instance.CurrentDBDocument
    #Dynamo input 
    baseLevel = UnwrapElement(IN[0])
    topLevel = UnwrapElement(IN[1])
    wallType = UnwrapElement(IN[2])
    #create point for line 
    pt1 = XYZ(0, 0, 0)
    pt2 = XYZ(10, 0, 0)
    #use safe transaction with Revit 
    TransactionManager.Instance.EnsureInTransaction(doc)
    #create line
    line = Line.CreateBound(pt1, pt2)
    #create wall using Revit API
    wall = Wall.Create(doc, line, baseLevel.Id, False)
    #Set the wall type to Dynamo input
    wall.WallType = wallType
    #Get the top constarint parameter using built in parameter
    #Revit Document shows it as WALL_HEIGHT_TYPE
    topConstraint = wall.get_Parameter(BuiltInParameter.WALL_HEIGHT_TYPE)
    #Set the top constraint 
    topConstraint.Set(topLevel.Id)
    #Finish Transaction with task done
    TransactionManager.Instance.TransactionTaskDone()
    
    OUT = wall

  • 相关阅读:
    深入理解线程通信
    你应该知道的 volatile 关键字
    CSS-盒模型与文本溢出笔记
    Html-表单笔记
    浏览器中缓存Cache
    python-对requests请求简单的封装
    【译】MongoDb vs Mysql—以NodeJs为例
    太嚣张了!他竟用Python绕过了“验证码”
    【转】Python之道
    selenium-测试框架搭建(十三)
  • 原文地址:https://www.cnblogs.com/ShirleyX/p/8023010.html
Copyright © 2011-2022 走看看