I am having an issue where I am trying to pass a parameter number into a curtain wall family- for a different reason- this family fails to build.
It then tells me that the family can not build and I should delete the type and replace the family (this happens with a revit box that pops up).
Is there a way inside rhino inside (or my python script) where I can see that it fails and then tell the script- actually I do not want to change the parameter (and in turn delete it).
Ideally I would just leave the family as is and record that there was an issue passing in the new parameter.
However, I want it to operate on all the ones it can make successfully, just not the ones that it cant.
I then press delete and replace and it just changes by default to a blank panel and loses all its infomation.
With my script:
I first find the paramter and then I try and set it, I do this within a try:
My script is below:
f Trigger:
with DB.Transaction(doc, 'test') as t:
t.Start()
for count, element_ind in enumerate(Element):
# Get the element name
PanelName = element_ind.Name
# Value for Element
Current_Value = (Value[count])
# Convert to correct revit units
Value_Conversion = UnitConverter.InHostUnits(Current_Value, DB.ParameterType.Length)
# Input Value
Element_Input = element_ind.LookupParameter("Panel_AngleIntersection_Input")
SetInput = Element_Input.Set(str(Current_Value))
Element_Input = element_ind.LookupParameter("Panel_AngleIntersection_Error")
SetInput = Element_Input.Set(str("Added"))
# Find the Keys Parameter
Element_Key_Value = element_ind.LookupParameter(Key)
Element_Key_Value_String = Element_Key_Value.AsString()
try:
SetValue = Element_Key_Value.Set(Value_Conversion)
Element_NewValue = element_ind.LookupParameter(Key)
# Pass out some information
except:
# This says if it cant get this value, then it sets 1000 instead
#SetValue = Element_Key_Value.Set(1000)
print("An exception occurred")
#Parameter_List.append("error")
t.Commit()
Excellent I will look into this- essentially I want a way to say if one of the families fails to make- roll that back… but keep trying to do the others and then commit.
“Loaded family curtain panels cannot be used in non-rectangular cells of the curtain host. Type-driven panels from non-rectangular cells were unlocked and left unchanged.”