- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Inventor 2022
API Visual Studio VB.NET
Hi,
i try to insert a Part in Assembly.
I want to Put the Part in a Position, which is defined with a SelectingPoint.
The Goal is to Set the Part in a StartPoint from a Projecting Curve.
Actualy, i want to Create a New Part, so that the Origin Point will be in Position of Start Point from Projecting Curve.
I got Error, when i select the Point.
This is the Code:
Imports System.Runtime.InteropServices
Imports Inventor
Imports Microsoft.Win32
Module CommandFunctionButton_01
Public Sub CommandFunctionfweButton_01()
Dim oAsmDoc As AssemblyDocument = g_inventorApplication.ActiveDocument
Dim oAsmCompDef As AssemblyComponentDefinition = oAsmDoc.ComponentDefinition
Dim oTO As TransientObjects = g_inventorApplication.TransientObjects
Dim oTG As TransientGeometry = g_inventorApplication.TransientGeometry
Dim oPointOriginSet As Vertex = g_inventorApplication.CommandManager.Pick(SelectionFilterEnum.kAllPointEntities, "Pick a Point")
Dim oPointOrigin As Point
oPointOrigin = oPointOriginSet.Point
Dim oXAxis As Vector = oTG.CreateVector(1, 0, 0)
Dim oYAxis As Vector = oTG.CreateVector(0, 1, 0)
Dim oZAxis As Vector = oTG.CreateVector(0, 0, 1)
Dim oMatrix As Matrix = oTG.CreateMatrix
Call oMatrix.GetCoordinateSystem(oPointOrigin, oXAxis, oYAxis, oZAxis)
Dim oOcc As ComponentOccurrence = oAsmCompDef.Occurrences.Add("C:\InventorAPI\001\CAD\3D\Part_02.ipt", oMatrix)
End Sub
End Module
Where is the Problem?
I was Trying o create the Point with, Object or Vertex, but always get a Error.
I dont want to write the Coordinate, i want to Select the Point.
Actualy, i want to Create a New Part, so that the Origin Point will be in Position of Start Point from Projecting Curve.
Thanks for any Suggestion
Solved! Go to Solution.