Sub CATMain() on error resume next Dim UserSelektion As Selection Set UserSelektion = CATIA.ActiveDocument.Selection Dim partDocument1 As Document Set partDocument1 = CATIA.ActiveDocument Dim product1 As CATBaseDispatch Set product1 =UserSelektion.Item2(1).Value.ReferenceProduct if err.number <> 0 then MsgBox ("Vor dem Start des Makros ein Part auswählen!!! Das Makro wird beendet") Exit Sub End if 'Antwort=MsgBox ("Dieses Makro löscht die vorhanden Parameter und ergänzt die"+Chr(10)+_ ' " Hahn Standard Parameter",1,"Parameter eintragen") 'if Antwort = vbOk then 'end if 'if Antwort = vbCancel then ' Exit Sub 'end if '*************************Vorhandene Paramter Löschen*********************** Dim ParamWorks As Parameters Set ParamWorks = product1.UserRefProperties if ParamWorks.Count > 0 Then 'MsgBox "Es sind schon Parameter vorhanden. Diese werden gelöscht."+Chr(10)+_ ' "Und die Standard Parameter werden eingetragen",48,"Parameter vorhanden" dim Array() As String Array_gr = ParamWorks.Count - 1 ReDim Array(Array_gr) Y=0 X=ParamWorks.Count For I=1 to X Geteilt = split (ParamWorks.Item(I).Name,"\") Array(Y)= Geteilt(2) 'MsgBox (""&Array(Y)) Y=Y+1 Next For Z = 0 to Array_gr ParamWorks.Remove""&Array(Z) Next End If product1.Nomenclature = "" CATIA.StartCommand ("Eigenschaften") End Sub