PPT_LOGO_4b
Revit Programming Introduction <#>
Copyright © 2009 Autodesk Inc.
コマンド 入力引数
»' List the app, doc and view data
»Dim revitApp As Revit.Application = commandData.Application
»Dim doc As Revit.Document = revitApp.ActiveDocument
»Dim view As Revit.Elements.View = commandData.View
»
»Dim sMsg As String = "Application = " & revitApp.VersionName & " " _
»  & revitApp.VersionNumber & vbCrLf
»sMsg += "Document path = " & doc.PathName & vbCrLf ' Empty if not saved yet
»sMsg += "Document title = " & doc.Title & vbCrLf
»sMsg += "View name = " & view.Name
»MsgBox(sMsg)
»
»' List the current selection set
»Dim sel As Selection = doc.Selection
»
»sMsg = "There are " & sel.Elements.Size & " elements in the selection set:"
»Dim elem As Revit.Element
»For Each elem In sel.Elements
»  sMsg += vbCrLf & "  " & elem.Category.Name & " Id=" & elem.Id.Value.ToString
»Next
»MsgBox(sMsg)
スタートアップ
In VB.NET
P21-1.jpg P21-2.jpg
コマンドの引数を確認するには、commandDataから取得したい情報にアクセスしていきます。