Set oSel = oDoc.Selection oSel.Clear otype(0) = "Point" oSel.Clear myPart.Activate Box = MsgBox("Bitte wählen sie die Punkte (3 Stück) aus", vbInformation + vbOKCancel, "Punkte auswählen") If Box = vbCancel Then Box = MsgBox("Sie haben die Selektion abgebrochen" + Chr(10) + _ "Das Makro wird nun beendet!", vbCritical, "Abbruch durch Nutzer") Exit Sub End If Do Auswahl = oSel.SelectElement2(otype, "Bitte wählen sie den " & ii + 1 & " Punkt aus", False) If Auswahl = "Normal" Then On Error Resume Next If RefPoint(0).Name = "" Then If Err.Number <> 0 Then Set RefPoint(0) = oSel.Item(1).Value oSel.VisProperties.SetRealColor 255, 127, 36, 1 End If ElseIf RefPoint(1).Name = "" Then If Err.Number <> 0 Then If oSel.Item(1).Value.Name = RefPoint(0).Name Then Beep Else Set RefPoint(1) = oSel.Item(1).Value oSel.VisProperties.SetRealColor 255, 127, 36, 1 End If End If ElseIf RefPoint(2).Name = "" Then If Err.Number <> 0 Then If oSel.Item(1).Value.Name = RefPoint(0).Name Or oSel.Item(1).Value.Name = RefPoint(1).Name Then Beep Else Set RefPoint(2) = oSel.Item(1).Value oSel.VisProperties.SetRealColor 255, 127, 36, 1 Check = True End If End If End If On Error GoTo 0 Else Box = MsgBox("Sie haben die Selektion abgebrochen" + Chr(10) + _ "Das Makro wird nun beendet!", vbCritical, "Abbruch durch Nutzer") Exit Sub End If Loop Until Check = True oSel.Clear Set sPoint = Selection.Item (1).Value sPoint.GetCoordinates aCoord cPointsName (iCount) = Selection.Item(1).Value.Name If TypeName (Doc) = "ProductDocument" Then Set opart_product = Selection.FindObject("CATIAProduct") opart_product.Position.GetComponents acoord_part_in_product cPointsX (iCount) = acoord_part_in_product(0) * aCoord (0) + acoord_part_in_product(3) * aCoord (1) + acoord_part_in_product(6) * aCoord (2) + acoord_part_in_product(9) cPointsY (iCount) = acoord_part_in_product(1) * aCoord (0) + acoord_part_in_product(4) * aCoord (1) + acoord_part_in_product(7) * aCoord (2) + acoord_part_in_product(10) cPointsZ (iCount) = acoord_part_in_product(2) * aCoord (0) + acoord_part_in_product(5) * aCoord (1) + acoord_part_in_product(8) * aCoord (2) + acoord_part_in_product(11) Else cPointsX (iCount) = aCoord (0) cPointsY (iCount) = aCoord (1) cPointsZ (iCount) = aCoord (2) End If End Sub