Skip to content

Commit

Permalink
#416 python updates
Browse files Browse the repository at this point in the history
  • Loading branch information
andydandy74 committed Dec 25, 2024
1 parent 366a629 commit 9d01a81
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 28 deletions.
17 changes: 1 addition & 16 deletions nodes/3.x/python/AngularDimension.ByElements.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,4 @@ def CreateAngularDimension(view, items, arc, dimtype):

TransactionManager.Instance.EnsureInTransaction(doc)
OUT = [CreateAngularDimension(view, x, y, dimtype) for x, y in zip(items, arcs)]
TransactionManager.Instance.TransactionTaskDone()

"""
TransactionManager.Instance.EnsureInTransaction(doc)
curvearray = CurveArray()
for curve in curves:
curvearray.Append(curve.ToRevitType())
doccreation = doc.Create
separatorarray = doccreation.NewRoomBoundaryLines(sketchplane, curvearray, view)
TransactionManager.Instance.TransactionTaskDone()
elementlist = list()
for item in separatorarray:
elementlist.append(item)
OUT = elementlist
"""
TransactionManager.Instance.TransactionTaskDone()
4 changes: 2 additions & 2 deletions nodes/3.x/python/Schedule.KeyScheduleParameterName.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from Autodesk.Revit.DB import *

def GetKeyScheduleParamName(schedule):
if hasattr(schedule, "KeyScheduleParameterName"): return schedule.KeyScheduleParameterName
else: return None
try: return schedule.KeyScheduleParameterName
except: return None

scheds = UnwrapElement(IN[0])

Expand Down
10 changes: 1 addition & 9 deletions nodes/3.x/python/ScheduleField.Parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,14 @@ def GetScheduleFieldParam(schedulefield):
if pId != ElementId.InvalidElementId:
# BuiltInParameters
if pId.IntegerValue < 0:
try: return bips[bipIds.index(pId.IntegerValue)]
try: return System.Enum.GetName(BuiltInParameter, pId.IntegerValue)
except: return None
# Project/Family/Shared Parameters
else: return schedulefield.Schedule.Document.GetElement(schedulefield.ParameterId)
else: return None
else: return None

schedulefields = UnwrapElement(IN[0])
bipsAll = System.Enum.GetValues(BuiltInParameter)
bips = []
bipIds = []
for bip in bipsAll:
try:
bips.append(bip)
bipIds.append(ElementId(bip).IntegerValue)
except: pass

if isinstance(IN[0], list): OUT = [GetScheduleFieldParam(x) for x in schedulefields]
else: OUT = GetScheduleFieldParam(schedulefields)
3 changes: 2 additions & 1 deletion nodes/3.x/python/ScheduleField.Type.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import clr
import System
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

def GetScheduleFieldType(field):
if hasattr(field, "FieldType"): return str(field.FieldType)
if hasattr(field, "FieldType"): return System.Enum.GetName(ScheduleFieldType, field.FieldType)
else: return None

if isinstance(IN[0], list): OUT = [GetScheduleFieldType(x) for x in IN[0]]
Expand Down

0 comments on commit 9d01a81

Please sign in to comment.