SolidWorksMakroprogrammierung

Methode · Component2

SetVisibility-Methode (Component2)

Blendet eine Komponente in bestimmten Konfigurationen ein oder aus.

Syntax

Sub SetVisibility( _
   ByVal State As Long, _
   ByVal Config_opt As Long, _
   ByVal Config_names As Variant _
)
swComp.SetVisibility swComponentHidden, swAllConfiguration, Empty

Parameter

StateLongByVal
Ein Wert aus swComponentVisibilityState_e: swComponentVisible (1) oder swComponentHidden (0).
Config_optLongByVal
Für welche Konfigurationen, ein Wert aus swInConfigurationOpts_e: swThisConfiguration (1), swAllConfiguration (2) oder swSpecifyConfiguration (3).
Config_namesVariantByVal
Nur bei swSpecifyConfiguration: Array mit den Namen der Konfigurationen, sonst Empty.

Beispiel

' swComp ist eine Component2, etwa aus AssemblyDoc.GetComponents.
swComp.SetVisibility swComponentHidden, swAllConfiguration, Empty

SetVisibility läuft ohne Fehler, kann aber wirkungslos bleiben: Component2.Visible liefert danach weiter 1 (sichtbar), auch nach einem Neuaufbau.

Siehe auch

Verfügbarkeit

SOLIDWORKS 2004

Englisches Original: IComponent2::SetVisibility in der SOLIDWORKS API-Hilfe ↗ (dort mit dem .NET-Namen)

Fragen zu diesem Befehl oder ein Befehl fehlt? Frag im Discord.