Enumeration · SwConst
swInConfigurationOpts_e-Enumeration
Für welche Konfigurationen ein Befehl wie Feature.SetSuppression2 etwas ändert oder liest: die aktive, alle oder bestimmte, deren Namen du mitgibst.
Syntax
Enum swInConfigurationOpts_e
swConfigPropertySuppressFeatures = 0
swThisConfiguration = 1
swAllConfiguration = 2
swSpecifyConfiguration = 3
swLinkedToParent = 4
swSpeedpakConfiguration = 5
End EnumWerte
| Konstante | Wert | Bedeutung |
|---|---|---|
swConfigPropertySuppressFeatures | 0 | Ohne Erklärung in der Hilfe, und kein Befehl nennt den Wert ausdrücklich. Dem Namen nach geht es um die Eigenschaft einer Konfiguration, Features zu unterdrücken. |
swThisConfiguration | 1 | Nur die aktive Konfiguration. |
swAllConfiguration | 2 | Alle Konfigurationen. |
swSpecifyConfiguration | 3 | Nur die Konfigurationen, deren Namen du im folgenden Parameter übergibst, meist Config_names: ein Array mit Namen. |
swLinkedToParent | 4 | Nur für abgeleitete Konfigurationen. Dem Namen nach bleibt die Einstellung mit der übergeordneten Konfiguration verknüpft. Bei einer nicht abgeleiteten Konfiguration nimmt SOLIDWORKS die aktive Konfiguration. |
swSpeedpakConfiguration | 5 | Dem Namen nach die SpeedPak-Konfigurationen. Die Hilfe nennt den Wert nur bei ConfigurationManager.AddRebuildSaveMark. |
Beispiel
' swFeat ist ein Feature, etwa aus SelectionMgr.GetSelectedObject6.
' swModel ist das aktive Dokument (ModelDoc2).
Dim sKonfig(1) As String
Dim bErfolg As Boolean
sKonfig(0) = "Lang"
sKonfig(1) = "Kurz"
' Erst überall aufheben, dann nur in „Lang“ und „Kurz“ unterdrücken
bErfolg = swFeat.SetSuppression2(swUnSuppressFeature, swAllConfiguration, Empty)
If bErfolg Then bErfolg = swFeat.SetSuppression2(swSuppressFeature, swSpecifyConfiguration, sKonfig)
If bErfolg Then swModel.EditRebuild3 Else Debug.Print "Nicht geändert"Bemerkungen
Die meisten Befehle erwarten den Wert in einem Parameter Config_opt oder WhichConfigurations und die Namen im nächsten Parameter, meist Config_names als Variant. Die Namen brauchst du nur bei swSpecifyConfiguration, sonst übergibst du Empty (bei manchen Befehlen nennt die Hilfe Nothing). Bei Dimension.GetValue3 und Dimension.GetSystemValue3 darf statt des Arrays auch ein einzelner Name stehen. AssemblyDoc.SetComponentState und Parameter.SetStringValue2 nehmen nur einen Namen als String. Befehle zum Lesen, etwa Feature.IsSuppressed2 oder Component2.GetVisibility, liefern ein Array mit einem Eintrag pro Konfiguration.
Nicht jeder Befehl nimmt jeden Wert. AssemblyDoc.SetSpeedPakConfigurations erlaubt nur swThisConfiguration, swAllConfiguration und swSpecifyConfiguration. Bei EquationMgr.Add3 verlangt die Hilfe swAllConfiguration, wenn du eine globale Variable zuweist oder eine Gleichung anlegst, die sie „component equation“ nennt. Bei swSpecifyConfiguration muss dort die aktive Konfiguration mit im Array stehen. Die Hilfe beschreibt die Werte bis auf swLinkedToParent nur mit ihrem Namen.
Zum Setzen eines Bemaßungswerts nehmen Dimension.SetSystemValue3 und Dimension.SetValue3 stattdessen die Werte aus swSetValueInConfiguration_e.
Verwendet von
AssemblyDoc.ActivateGroundPlane AssemblyDoc.GetActiveGroundPlane AssemblyDoc.SetComponentState AssemblyDoc.SetComponentVisibility AssemblyDoc.SetSpeedPakConfigurations AttributeDef.CreateInstance5 Body2.RemoveMaterialProperty Component2.GetExcludeFromBOM2 Component2.GetMaterialPropertyValues2 Component2.GetVisibility Component2.RemoveMaterialProperty2 Component2.SetExcludeFromBOM2 Component2.SetMaterialPropertyValues2 Component2.SetVisibility ConfigurationManager.AddRebuildSaveMark Dimension.GetSystemValue3 Dimension.GetValue3 EquationMgr.Add3 EquationMgr.GetConfigurationOption EquationMgr.SetEquationAndConfigurationOption ExtrudeFeatureData2.SetChangeToConfigurations Face2.GetMaterialPropertyValues2 Face2.RemoveMaterialProperty2 Face2.SetMaterialPropertyValues2 Feature.GetMaterialPropertyValues2 Feature.IsSuppressed2 Feature.RemoveMaterialProperty2 Feature.SetBodiesToKeep Feature.SetMaterialPropertyValues2 Feature.SetSuppression2 MassProperty.SetAssignedMassProp MassProperty.SetOverrideCenterOfMassValue MassProperty.SetOverrideMassValue MassProperty.SetOverrideMomentsOfInertiaValue MassProperty.SetOverridePrincipleAxesOrientation MassProperty.SetOverridePrincipleMomentsOfInertia MassProperty2.SetOverrideOptions ModelDoc2.EditDimensionProperties3 ModelDocExtension.ChangeSketchPlane ModelDocExtension.EditDimensionProperties ModelDocExtension.GetMaterialPropertyValues ModelDocExtension.RemoveMaterialProperty ModelDocExtension.SetMaterialPropertyValues Parameter.SetStringValue2 Parameter.SetVector2 PartDoc.SetMaterialVisualProperties
Siehe auch
In den Videos
Englisches Original: swInConfigurationOpts_e in der SOLIDWORKS API-Hilfe ↗
Fragen zu diesem Befehl oder ein Befehl fehlt? Frag im Discord.