Cannot set base-top constraint of slanted column

Cannot set base-top constraint of slanted column

Anonymous
Not applicable
575 Views
1 Reply
Message 1 of 2

Cannot set base-top constraint of slanted column

Anonymous
Not applicable

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 propertiesexpected propertiesexpected snoopexpected snoop

However, after running my code to set the parameter what I had were:

result propertiesresult propertiesresult snoopresult snoopbase level parameterbase 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,

0 Likes
576 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk
0 Likes