SolidWorksMakroprogrammierung

Methode · ModelDoc2

AddConfiguration3-Methode (ModelDoc2)

Legt eine neue Konfiguration an und aktiviert sie.

Syntax

Function AddConfiguration3( _
   ByVal Name As String, _
   ByVal Comment As String, _
   ByVal AlternateName As String, _
   ByVal Options As Long _
) As Object
Set swConf = swModel.AddConfiguration3("Lang", "", "", 0)

Parameter

NameStringByVal
Name der neuen Konfiguration.
CommentStringByVal
Kommentar in den Eigenschaften der Konfiguration.
AlternateNameStringByVal
Name in der Stückliste, gilt nur mit swConfigOption_UseAlternateName.
OptionsLongByVal

Optionen aus swConfigurationOptions2_e, zusammengezählt, zum Beispiel:

  • swConfigOption_UseAlternateName (1): AlternateName in der Stückliste zeigen
  • swConfigOption_SuppressByDefault (4): neue Features in dieser Konfiguration unterdrücken
  • swConfigOption_DontActivate (128): neue Konfiguration nicht aktivieren

Rückgabewert

Die neue Configuration, oder Nothing.

Beispiel

' swModel ist das aktive Teil.
Dim swConf As SldWorks.Configuration
Set swConf = swModel.AddConfiguration3("Lang", "per Makro angelegt", "", 0)
If swConf Is Nothing Then Debug.Print "Anlegen fehlgeschlagen (Name schon vergeben?)"

Bemerkungen

Ohne swConfigOption_DontActivate ist die neue Konfiguration danach aktiv. Mehr Einstellungen, etwa eine übergeordnete Konfiguration, bietet ConfigurationManager.AddConfiguration2. Dass bei einem schon vergebenen Namen Nothing kommt, sagt die Hilfe nicht ausdrücklich.

Siehe auch

Verfügbarkeit

SOLIDWORKS 2001Plus

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

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