Cannot set base-top constraint of slanted column

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys, I encountered an interesting problem today that I want to share with everyone and hopefully someone can shed some light into the matter.
So I created a bunch of slanted columns via the revit API with the method NewFamilyInstance(Curve, FamilySymbol, Level, StructuralType) Everything is fine, then I wanted to change the base and top level of the newly created column for scheduling later on. what I expected were:
expected properties
expected snoop
However, after running my code to set the parameter what I had were:
result properties
result snoop
base level parameter
The code I used to set element's parameter was:
foreach (FamilyInstance column in columnCol) { Parameter baseLevel = column.get_Parameter(BuiltInParameter.FAMILY_BASE_LEVEL_PARAM); baseLevel.Set(levelForBase.LevelId); Parameter topLevel = column.get_Parameter(BuiltInParameter.FAMILY_TOP_LEVEL_PARAM); topLevel.Set(levelForTop.LevelId); }
I don't get why the base and top constraint turned null after running the code. I suspected the Level parameter(read only) of the element is set when I created the family instance, and cannot be changed via the API. However, I can still manually change base and top level parameters via the UI. Note that I did not receive any error nor exceptions from Revit, and I used the same code to change other parameters without any problem. So can anyone help me understand this problem please?
Best reagrads,