ProjectItem.Selected operator

説明

オブジェクトが選択されているが(true)そうでないか(false)を示すBoolean値を戻します。

注:Python ではプロパティ上の入力パラメータがサポートされていないので、このプロパティは失敗します。代わりに、ProjectItem.IsSelectedメソッドおよびProjectItem.SetAsSelected(Python の場合)を使用してください。

パラメータ

パラメータ タイプ 詳細
BranchFlag siBranchFlag オブジェクトがノード選択かブランチ選択かを示します。

子を持つModelおよびX3DObjectなどのオブジェクトのみに適用されます。

デフォルト値:siNode

VBScript の例

' 
' This example demonstrates how to determine if the object is node or branch selected.
' 
NewScene , false
set oSphere = Application.ActiveProject.ActiveScene.Root.AddGeometry( "Sphere", "NurbsSurface" )
if oSphere.Selected then
        Application.LogMessage "Sphere is selected"
else
        Application.LogMessage "Sphere is NOT selected"
end if
SelectObj "sphere", "BRANCH", True
if oSphere.Selected(1) then
        Application.LogMessage "Sphere is branch-selected"
else
        Application.LogMessage "Sphere is NOT branch-selected"
end if
' Expected result:
'INFO : Sphere is NOT selected
'INFO : Sphere is branch-selected

関連項目

ProjectItem.IsSelected ProjectItem.SetAsSelected SelectObj