PPT_LOGO_4b
Revit Programming Introduction <#>
Copyright © 2009 Autodesk Inc.
壁を選択する
»Dim doc As Revit.Document = commandData.Application.ActiveDocument
»Dim ss As ElementSet = doc.Selection.Elements
»
»' must have single element only
»If Not ss.Size = 1 Then
»  MsgBox( "You must pre-select a single element!" )
»  Return IExternalCommand.Result.Cancelled
»End If
»
»' must be a wall
»Dim iter As ElementSetIterator = ss.ForwardIterator
»iter.MoveNext()
»Dim elem As Revit.Element = iter.Current
»If Not TypeOf elem Is Wall Then
»  MsgBox( "Selected element is NOT a wall!" )
»  Return IExternalCommand.Result.Cancelled
»End If
»Dim wall As Wall = elem
要素コレクション
例えば、壁を選択した後・・・