Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: Anonymous

Since you are dealing with a Part, perhaps something like the following would work for you.

Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
'Dim oBody As SurfaceBody = oDef.SurfaceBodies.Item(1)
Dim oBody As SurfaceBody = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartBodyFilter, "Select a Part Body.")
Dim oMoveFeatDef As MoveDefinition = oDef.Features.MoveFeatures.CreateMoveDefinition(oBody)
Dim oAxis As WorkAxis = oDef.WorkAxes.Item(1)
oMoveFeatDef.AddRotateAboutAxis(oAxis, False, "90 deg")
Dim oMoveFeat As MoveFeature = oDef.Features.MoveFeatures.Add(oMoveFeatDef)
oMoveFeat.Name = "Rotate " & oBody.Name & " About " & oAxis.Name & " By 90 degrees"

It uses the MoveBody command, but instead of a linear move, it uses the not-so-obvious option (normally hidden within the drop-down) of rotation.  This assumes it is all one body, and not several solid bodies. 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)