说到装配式建筑你一定不会陌生,很可能你所购买的房屋就是以这种方式施工建造的。住宅类项目因其构件标准性,楼层的可复制性而易实现建筑构件的工厂化生产,避免了大量的施工现场浇筑带来的效率低,资源浪费等问题。

        在上个月湖北省住建厅发布的“关于开展施工图BIM审查试点工作的通知”中就将采用装配式技术的新建房屋建筑工程项目纳入施工图BIM审查试点范围。

        而在机电安装工程中应用装配式技术的无疑要数制冷机房的装配式施工了。

(某项目制冷机房)

那么BIM+装配式又会碰出怎样的火花呢?

(某项目BIM装配式制冷机房实施成果)

具体实施原理就是在软件中建立的达到预制精度的revit模型通过一定功能要求组合为预制管段,创建成部件(AssemblyInstance),创建部件视图(AssemblyView),将部件视图拖放在创建好的图纸中,然后再进行详尽的标注工作。

由于预制管段的数量众多,可能会有上百个预制管段,那么就可使用Dynamo程序将上述的一步步操作固化下来,从而减少了重复性劳动。

总体思路:选择构件,创建部件,将选择的图元在视图中临时隐藏,创建部件视图,创建图纸,设置预制管段编号和图纸名称,将部件视图放置在图纸中。

  1. 选择多个图元,在管道U形翻弯电缆桥架快速翻弯已有介绍

import clr
clr.AddReference('RevitAPIUI')from Autodesk.Revit.UI import *from Autodesk.Revit.UI.Selection import *
clr.AddReference('RevitAPI')from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')import RevitServicesfrom RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocumentuidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
ele_ref = uidoc.Selection.PickObjects(ObjectType.Element)eles = [][eles.append(doc.GetElement(i)) for i in ele_ref]OUT = eles

2.创建部件并修改部件名称

import clrfrom System.Collections.Generic import *clr.AddReference('RevitAPI')from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")import Revitclr.ImportExtensions(Revit.GeometryConversion)clr.ImportExtensions(Revit.Elements)
clr.AddReference("RevitServices")import RevitServicesfrom RevitServices.Persistence import DocumentManagerfrom RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocumenteles = UnwrapElement(IN[0])assembly_name = IN[1]#创建部件TransactionManager.Instance.EnsureInTransaction(doc)ids = list()for ele in eles:  ids.append(ele.Id)  idElements = List[ElementId](ids)Ass_Ins = AssemblyInstance.Create(doc, idElements, eles[0].Category.Id)TransactionManager.Instance.TransactionTaskDone()TransactionManager.Instance.ForceCloseTransaction()
#修改部件名称TransactionManager.Instance.EnsureInTransaction(doc)Ass_Ins.AssemblyTypeName = assembly_name TransactionManager.Instance.TransactionTaskDone()
OUT = Ass_Ins.ToDSType(True)

3.为避免已创建部件的构件影响下一步选择构件,将其在视图中临时隐藏

import clr
clr.AddReference('RevitAPI')from Autodesk.Revit.DB import *
clr.AddReference('System')from System.Collections.Generic import List
clr.AddReference('RevitNodes')import Revitclr.ImportExtensions(Revit.GeometryConversion)clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')import RevitServicesfrom RevitServices.Persistence import DocumentManagerfrom RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
eles = UnwrapElement(IN[0])view = UnwrapElement(IN[1])
ids = list()for ele in eles:  ids.append(ele.Id)  idElements = List[ElementId](ids)
#临时隐藏图元TransactionManager.Instance.EnsureInTransaction(doc)view.HideElementsTemporary(idElements)TransactionManager.Instance.TransactionTaskDone()
OUT = "elements are hidden successfully"

4.为部件创建部件视图,这里我选择了三维视图,详图视图顶视图,详图视图右视图,明细表视图

import clr
clr.AddReference('RevitAPI')from Autodesk.Revit.DB import *
clr.AddReference('RevitNodes')import Revitclr.ImportExtensions(Revit.GeometryConversion)clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')import RevitServicesfrom RevitServices.Persistence import DocumentManagerfrom RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
#设置部件视图的详细程度为精细和显示模式为着色Ass_ins = UnwrapElement(IN[0])def SetViewDisplayModel(v):  v.DetailLevel = ViewDetailLevel.Fine  v.DisplayStyle = DisplayStyle.Shading  return v#创建部件视图,三维视图、顶视图、侧视图、明细表视图TransactionManager.Instance.EnsureInTransaction(doc)Ass_View1 = AssemblyViewUtils.Create3DOrthographic(doc,Ass_ins.Id)SetViewDisplayModel(Ass_View1)Ass_View2 = AssemblyViewUtils.CreateDetailSection(doc,Ass_ins.Id,AssemblyDetailViewOrientation.HorizontalDetail)SetViewDisplayModel(Ass_View2)Ass_View3 = AssemblyViewUtils.CreateDetailSection(doc,Ass_ins.Id,AssemblyDetailViewOrientation.ElevationRight)SetViewDisplayModel(Ass_View3)Ass_View4 = AssemblyViewUtils.CreatePartList(doc,Ass_ins.Id)TransactionManager.Instance.TransactionTaskDone()
OUT = [Ass_View1,Ass_View2,Ass_View3,Ass_View4]

部件详图为枚举类型,一共有以下几个可供选择

5.创建图纸

import clr
clr.AddReference('RevitAPI')from Autodesk.Revit.DB import *
clr.AddReference('RevitNodes')import Revitclr.ImportExtensions(Revit.GeometryConversion)clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')import RevitServicesfrom RevitServices.Persistence import DocumentManagerfrom RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
Fm_Ty = UnwrapElement(IN[0])
#创建图纸TransactionManager.Instance.EnsureInTransaction(doc)
Sheet = ViewSheet.Create(doc,Fm_Ty.Id).ToDSType(True)
TransactionManager.Instance.TransactionTaskDone()
OUT = Sheet

6.设置图名称,可根据项目实际要求构造图纸命名和预制管段命名规则

7.将新建视口并放置在已创建的图纸中,因明细表视图和其他视图放置在图纸中的方法不同故分而处理

import clr
clr.AddReference('RevitAPI')from Autodesk.Revit.DB import *
clr.AddReference('RevitNodes')import Revitclr.ImportExtensions(Revit.GeometryConversion)clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')import RevitServicesfrom RevitServices.Persistence import DocumentManagerfrom RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
Sheet = UnwrapElement(IN[0])View = UnwrapElement(IN[1])Pt = IN[2]View_Ports = []
#将视口放入图纸中TransactionManager.Instance.EnsureInTransaction(doc)#文档刷新doc.Regenerate()for s,v, p in zip(Sheet,View,Pt):  if v.ToString() == "Autodesk.Revit.DB.ViewSchedule":    View_Port = ScheduleSheetInstance.Create(doc,s.Id,v.Id,p.ToXyz())  else:    View_Port = Viewport.Create(doc,s.Id,v.Id,p.ToXyz())  View_Ports.append(View_Port)TransactionManager.Instance.TransactionTaskDone()
OUT = View_Ports

完整程序:

运行效果:

欢迎阅读,分享,交流,批评指正。

如转载请注明出处,否则追究法律责任(说说而已,全靠自觉)。

0

评论0

请先
高清、正式版 DG/TJ 08-2068-2019 超高压喷射注浆技术标准.pdf
高清、正式版 DG/TJ 08-2068-2019 超高压喷射注浆技术标准.pdf
刚刚 有人购买 去瞅瞅看

社交账号快速登录

微信扫一扫关注
扫码关注后会自动登录网站