Autodesk.Revit.DB.Fabrication.FabricationUtils.ExportToPCF:
import clrclr.AddReference('ProtoGeometry')from Autodesk.DesignScript.Geometry import *clr.AddReference('RevitAPI')import Autodeskfrom Autodesk.Revit.DB import *clr.AddReference("RevitServices")import RevitServicesfrom RevitServices.Persistence import DocumentManagerfrom RevitServices.Transactions import TransactionManagerclr.AddReference('RevitAPI')from Autodesk.Revit.DB import *clr.AddReference('RevitAPIUI')import Autodeskfrom Autodesk.Revit.UI import *doc = DocumentManager.Instance.CurrentDBDocumentuidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocumentpath = IN[1]def get_selected_elements(): ids = uidoc.Selection.GetElementIds() if isinstance(ids, list) == True: ids=[ids] els = [] for id in ids: el = doc.GetElement(id) els.append(el.Id) return elsTransactionManager.Instance.EnsureInTransaction(doc)els = get_selected_elements()Autodesk.Revit.DB.Fabrication.FabricationUtils.ExportToPCF(doc,els,path)TransactionManager.Instance.TransactionTaskDone()
- BIM学习群
- 微信扫一扫
- 微信公众号
- 微信扫一扫