パラメータ間にある関係により、1 つのパラメータの値が次のような影響を与えることがあります。
また、一部のパラメータは常時読み込み専用になります。
壁の長さや面積パラメータなどの一部のパラメータは、Revit で計算されます。これらのパラメータは要素の内部状態に依存するため、常時読み込み専用となります。
図 29: 壁の計算されたパラメータ
このコード サンプルでは、開口部の敷居の高さパラメータが調整され、その結果、上端高さパラメータが再計算されています。
|
コード領域 8-6: パラメータの関係の例 |
// opening should be an opening such as a window or a door
public void ShowParameterRelationship(FamilyInstance opening)
{
// get the original Sill Height and Head Height parameters for the opening
Parameter sillPara = opening.get_Parameter(BuiltInParameter.INSTANCE_SILL_HEIGHT_PARAM);
Parameter headPara = opening.get_Parameter(BuiltInParameter.INSTANCE_HEAD_HEIGHT_PARAM);
double sillHeight = sillPara.AsDouble();
double origHeadHeight = headPara.AsDouble();
// Change the Sill Height only and notice that Head Height is recalculated
sillPara.Set(sillHeight + 2.0);
double newHeadHeight = headPara.AsDouble();
MessageBox.Show("Old head height: " + origHeadHeight + "; new head height: "
+ newHeadHeight);
}
|