Does anyone know of the best appraoch to passing Points and/or vectors as parameters to external functions written using VB.NET and incorperating Inventor API calls?
I would like to have a function written in Intent that looks something like:
Function iv_FooBar(PointParam As Point, VectParam as Vector) As String
But I am unclear as to what the VB end needs to look like:
I was hoping to have something like:
Public SharedFunction iv_FooBar(ByVal PointParam As Inventor.ComponentOccurrence, ByVal VectParam as ????????) As String
But I guess it's not as simple as that!
Solved! Go to Solution.
Solved! by nagwani. See the answer in context.
Can you please close the problem.
You just need to create Inventor point and vector using %%inventorapplication object in ETO 2012 or inventorapplication rule in 2013. Below is my Intent method which called external VB function with two arguments. I have also given the sample code of VB DLL.
Method TestExternalVB() As String
Dim pt As Any = %%inventorapplication.transientgeometry.createpoin
Dim vec As Any = %%inventorapplication.transientgeometry.createvect
' The name of DLL is ExternallVBFunction
' The name of Class is MyExternalFunctions
' The name of Function in class is iv_FooBar
Dim customFunction As Any = New ExternallVBFunction.MyExternalFunctions()
Dim s As String
' Code of VB DLL
Public Class MyExternalFunctions
Public Function iv_FooBar(ByVal pt As Inventor.Point, ByVal vec As Inventor.Vector) As String
Dim s As String
s = "Point:" + CStr(pt.X) + "," + CStr(pt.Y) + "," + CStr(pt.Z)
Access a broad range of knowledge to help get the most out of your products and services.