Code:
Public CurveFProfil As HybridShapeCurveExplicit
Public initfile As Document
Public initpart As Part
Public initfilename, macro, version, newfilename, newpath, qpfad, qdatei(10) As String
Public datum
Public UselLine, UselSurface As ObjectSub m1()
Set initfile = CATIA.ActiveDocument
Set initpart = initfile.Part
initfilename = initpart.name
qpfad = "C:\profil_template\"
qdatei(0) = ""
qdatei(1) = "PROFIL_WORK.CATProduct"
qdatei(2) = "PROFIL.CATPart"
Profil_Start_Form.Show
end sub
Private Sub linie_Click()
Profil_Start_Form.Hide
Dim Auswahl
Dim CurveSel
Set UselLine = initfile.Selection
UselLine.Clear
Dim Was(0)
Was(0) = "HybridShapeCurveExplicit"
Auswahl = UselLine.SelectElement2(Was, "Bitte den Kurvenverlauf wählen.", False)
' User wählt Kurve aus
Set CurveSel = UselLine.Item(1).Value
Set CurveProfil = CurveSel 'Zuweisung auf globale Variable
Profil_Start_Form.Show 'Auswahlfenster anzeigen
End Sub
Private Sub START_Click()
UselLine.Copy
Dim par1 As PartDocument
Set par1 = d1.Open(qpfad & qdatei(2))
Set par1 = CATIA.ActiveDocument
Dim pd As Part
Set pd = par1.Part
'######### PASTE???? ####################
UselLine.Clear '## selektion erneut löschen
'UselLine.Add (pd) '## zielpart der selektion hinzufügen
UselLine.PasteSpecial "CATIA_RESULT"
'## oder einfügen mit "CATPrtResultWithOutLink"
'### CATIA.ActiveDocument.Selection.Paste() ###
'pd.UpdateObject hybridShapeCurveExplicit1
'#### ENDE ENDE ENDE ???? #########################################
'Save Product & Parts ?
MsgBox "Achtung Ende!"
' CreateSendTo( )
Unload Profil_Start_Form
End Sub