Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Inventor 2022
API VB.NET VisualStudio
I try to get Access to Face with API, but after a Feature "MoveFeature".
I got Error.
I am in Part Envireoment, should i also use a FaceProxy, but i dont understand this.
When i Select the Extrusion, then it show me the Origin Position.
What is it now a FaceProxy?
How to use the Face after MoveFeature.
This is my Code:
Imports System.Runtime.InteropServices
Imports Inventor
Imports Microsoft.Win32
Imports System.Collections.Generic
Imports System.Linq
Imports System.IO
Module CommandFunctionButton_10
Public Sub CommandFunctionfweButton_10()
Dim oPartDoc As PartDocument = g_inventorApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition
Dim oTO As TransientObjects = g_inventorApplication.TransientObjects
Dim oTG As TransientGeometry = g_inventorApplication.TransientGeometry
Dim oSurfaceBody As SurfaceBody = oCompDef.SurfaceBodies.Item(1)
Dim oFaceOrigin As Face = oSurfaceBody.Faces.Item(1)
Dim oVertex As Vertex = oFaceOrigin.Vertices.Item(1)
Dim oVertexPoint As Point = oVertex.Point
Dim oCenterPoint As WorkPoint = oCompDef.WorkPoints.Item(1)
Dim oCenterPointOrigin As Point = oCenterPoint.Point
Dim oDistanceFromOrigin As Double = oVertexPoint.DistanceTo(oCenterPointOrigin)
Dim oWorkAxis As WorkAxis = oCompDef.WorkAxes.AddByTwoPoints(oVertex, oCenterPoint)
Dim oObjColl As ObjectCollection = oTO.CreateObjectCollection
oObjColl.Add(oSurfaceBody)
Dim oMoveDef As MoveDefinition = oCompDef.Features.MoveFeatures.CreateMoveDefinition(oObjColl)
Dim oMoveAlongAxis As MoveAlongRayMoveOperation = oMoveDef.AddMoveAlongRay(oWorkAxis, True, oDistanceFromOrigin)
Dim oMoveFeature As MoveFeature = oCompDef.Features.MoveFeatures.Add(oMoveDef)
Dim oFace As Face = oSurfaceBody.Faces.Item(2)
End Sub
End Module
Error: Unknow Error
Thanks for Any Suggestion
Solved! Go to Solution.