Hallo zusammen,
ich möchte mir die Schwerpunktkoordinaten von einem Body anzeigen lassen. Dies habe ich mit "Measurable" versucht. Leider läuft das Programm nicht. Was habe ich falsch gemacht?
Vielen Dank für Eure Hilfe!
Gruß
------------------------------------------------------------
Sub CATMain ( )
Set myDocument = CATIA.ActiveDocument
Set myPart = myDocument.Part
Set myBodies = myPart.Bodies
Set myBody = myBodies.Item("A")
Set mySelection = myDocument.Selection
mySelection.Add myBody
Dim TheSPAWorkbench As Workbench
Set TheSPAWorkbench = CATIA.ActiveDocument.GetWorkbench "SPAWorkbench")
Dim TheMeasurable As Measurable
Set TheMeasurable = TheSPAWorkbench.GetMeasurable(mySelection)
Dim myCoordinates (2)
TheMeasurable.GetCOG myCoordinates
Dim Coord_X, Coord_Y, Coord_Z
Coord_X=myCoordinates(0)
Coord_Y=myCoordinates(1)
Coord_Z=myCoordinates(2)
MsgBox ("X=" & Coord_X & ",Y=" & Coord_Y & ",Z=" & Coord_Z)
End Sub
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP