02-14-2020
05:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
02-14-2020
05:47 AM
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
(Not an Autodesk Employee)