© 2010 Autodesk
Introduction to Revit 2011 API
要素
 Parameter プロパティと 組み込みパラメータ ID  
§ABC
§
<VB.NET>
    ''  examples of retrieving a specific parameter individlly. 
    Public Sub RetrieveParameter(ByVal elem As Element, _
                                 Optional ByVal header As String = "")
 
        Dim s As String = header + vbCr + vbCr
        ''  comments - most of instance has this parameter
        ''  (1) by name.  (Mark - most of instance has this parameter.)
        param = elem.Parameter(“マーク")
        ...
        ''  (2) by BuiltInParameter.
        Dim param As Parameter = _
            elem.Parameter(BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS)
        ...
        ''  using the BuiltInParameter, you can sometimes access one
        ''  that is not in the parameters set.
        param = elem.Parameter(BuiltInParameter.SYMBOL_FAMILY_AND_TYPE_NAMES_PARAM)
        ...
        param = elem.Parameter(BuiltInParameter.SYMBOL_FAMILY_NAME_PARAM)
        ...
</VB.NET>
このサンプルは要素からパラメータを指定してそれを取得する例です。

まず、”マーク“という名前を指定してパラメータを取得します。

次からは、注釈、ファミリ名とタイプ名、そしてファミリ名を組み込みパラメータIDを指定して取得しています。

作成するコードを出来る限り言語非依存にするために、パラメータ名はハードコードするのではなく、可能な範囲で組み込みパラメータ IDを使用推奨いたします。