Hi,
Im not getting errors with getting the technological object for the catpart. But it's returning nothing about the part I want to analyze inertia on (and yes the part has a body called "PartBody").
Am I using the gettechnologicalobject method on the wrong document? Please let me know if Im doing something wrong or missing somethin.g
Thanks,
'-----------
Sub CATMain()
Dim productDocument1 As ProductDocument
Set productDocument1 = CATIA.ActiveDocument
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Dim partDocument1 As PartDocument
Set partDocument1 = documents1.GetItem("My_model_XXXXX.CATPart")
Dim part1 As Part
Set part1 = partDocument1.Part
Dim bodies1 As Bodies
Set bodies1 = part1.Bodies
Dim body1 As Body
Set body1 = bodies1.Item("PartBody")
Dim inertia_
set inertia_ = body1.GetTechnologicalProduct ("Inertia")
dim cg (2)
inertia_.GetCOGposition cg
msgbox cg(0)
End Sub
Im not getting errors with getting the technological object for the catpart. But it's returning nothing about the part I want to analyze inertia on (and yes the part has a body called "PartBody").
Am I using the gettechnologicalobject method on the wrong document? Please let me know if Im doing something wrong or missing somethin.g
Thanks,
'-----------
Sub CATMain()
Dim productDocument1 As ProductDocument
Set productDocument1 = CATIA.ActiveDocument
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Dim partDocument1 As PartDocument
Set partDocument1 = documents1.GetItem("My_model_XXXXX.CATPart")
Dim part1 As Part
Set part1 = partDocument1.Part
Dim bodies1 As Bodies
Set bodies1 = part1.Bodies
Dim body1 As Body
Set body1 = bodies1.Item("PartBody")
Dim inertia_
set inertia_ = body1.GetTechnologicalProduct ("Inertia")
dim cg (2)
inertia_.GetCOGposition cg
msgbox cg(0)
End Sub