Hi there,
I am having a multibody part. The parts are not aligned to the master planes (XY, YZ & XZ) hence the bounding box does not give the true lengths of these parts.
Currently, I am direct editing each part to rotate and snap it parallel to one of the plane (This is manual). After that, I have a code that measures the bounding box dimensions and this is how I get the true lengths.
However, I have multiple bodies in the parts (say 50+) and I need to do direct editing for each and every body individually. This is extremely hectic.
I was wondering if there is a code or any function that will automatically run the Direct Edit-Rotate-Solid-Snap Parallel-(XY, YZ, XZ) Plane command without any manual intervention.
I am able to execute the direct editing command using the following lines of code :
"Sub Main()
Dim invApp As Inventor.Application = GetObject(, "Inventor.Application")
Dim body As SurfaceBody
body = invApp.CommandManager.Pick(SelectionFilterEnum.kPartBodyFilter, "Select the body.")
Dim oCtrlDef As ControlDefinition
oCtrlDef = ThisApplication.CommandManager.ControlDefinitions.Item("PartDirectCmd")
oCtrlDef.Execute
End Sub"
Still there is a lot of manual work ahead.
Thanks in advance.
Aman