Hi guys,
I don’t understand why it doesn’t see the solid in first instance. it works after I disconnect the last node and connect it back.
Any idea?
create slab edge.dyn (12.1 KB)
the idea is that I create a foundation slab and I want to add slab edge to it later on
First guess: because in Revit speak the first run is creating both the slab and the slab edge as a single transaction. Try adding a Transaction End after the first Python node to see if that fixes it.
1 Like
Thank you Jacob, it worked
1 Like
there appears another problem:
when I try to use the obtained solid for extracting its edges, it does first time, and the second time it brings a empty list
the solid is still provided but can’t extract its egdes
for i in solid:
edges = i.Edges
import clr
import math
# Import Dynamo Nodes
clr.AddReference('DSCoreNodes')
import DSCore
from DSCore import *
#Import Revit Nodes
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.GeometryReferences)
#from Revit.Elements import *
from Revit.Elements import Family as EFamily
from Revit.Elements import FamilyType as EFamilyType
from Revit.Elements.Family import Types as ETypes
from Revit.Elements import Element as EElement
from Revit.Elements.StructuralFraming import BeamByCurve as EBeamByCurve
# Import RevitAPI
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
from clr import StrongBox
# Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import System
clr.AddReference('System')
from System.Collections.Generic import *
import RevitServices
import sys
import System
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)
import os
slab = IN[0][0]
doc = DocumentManager.Instance.CurrentDBDocument
#extract references
opt = Options()
opt.ComputeReferences = True
opt.IncludeNonVisibleObjects = False
TransactionManager.Instance.EnsureInTransaction(doc)
#extract references
if True:
solid = UnwrapElement(slab).get_Geometry(opt)
for i in solid:
edges = i.Edges
TransactionManager.Instance.TransactionTaskDone()
OUT = solid, edges
what am I doing wrong?