SolidWorksMakroprogrammierung

Methode · PartDoc

InsertPart3-Methode (PartDoc)

Fügt ein anderes Teil als abgeleitetes Teil am Ursprung ein.

Syntax

Function InsertPart3( _
   ByVal FileName As String, _
   ByVal Options As Long, _
   ByVal ConfigurationName As String _
) As Feature
Set swFeat = swPart.InsertPart3("C:\Daten\Rohteil.SLDPRT", swInsertPartImportSolids, "")

Parameter

FileNameStringByVal
Pfad des Teils.
OptionsLongByVal
Was übernommen wird, Werte aus swInsertPartOptions_e zusammengezählt, etwa swInsertPartImportSolids (1), swInsertPartImportPlanes (8), swInsertPartBreakLink (512).
ConfigurationNameStringByVal
Konfiguration des eingefügten Teils.

Rückgabewert

Das neue Feature.

Beispiel

' swPart ist das PartDoc, etwa per Set swPart = swModel.
Dim swFeat As SldWorks.Feature
Set swFeat = swPart.InsertPart3("C:\Daten\Rohteil.SLDPRT", swInsertPartImportSolids + swInsertPartImportPlanes, "")
If swFeat Is Nothing Then Debug.Print "Nicht eingefügt"

Bemerkungen

Das Teil landet am Ursprung. Andere Lage oder Drehung erreichst du danach mit FeatureManager.InsertMoveCopyBody2. Ob "" für die Standardkonfiguration erlaubt ist, sagt die Hilfe nicht. Der Pfad ist ein Platzhalter.

Siehe auch

Verfügbarkeit

SOLIDWORKS 2019

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

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