Autodesk Inventor Engineer-to-Order
- Start Article
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
run DLL
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
I'm trying to run a simple .dll from ETO but can't acheive anything!!!!
Here's my approach:
Copied the .dll is in the Design Files folder of the current project.
Tested in ETO --> Rule myValuesAdded As Number = ClassLibrary1.Class1.AddMyValues(5, 2)
I get --> No such method 'AddMyValues' while calling (static) on ClassLibrary1.Class1
' Here is the dll...
Public Class Class1
Public Function AddMyValues(ByVal Value1 As Double, ByVal Value2 As Double)
Dim Result As Double
Result = Value1 + Value2
Return Result
End Function
End Class
' Created a simple form to test the dll...it works just fine!!!
Imports ClassLibrary1
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim Add As New ClassLibrary1.Class1
TextBox3.Text = Add.AddMyValues(CDbl(TextBox1.Text), CDbl(TextBox2.Text)).ToString
End Sub
End Class
Any help would be appreciated.
Regards,
Re: run DLL
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
See if the attached helps (code from Jon Balgley's Potlatch presentation on this topic).
Intent rules:
Rule cus1 = New vbclasslib.customer("Jon", "Balgley", "503-555-1234")
Rule cus2 = New vbclasslib.customer("Jon", "Yelglab", "503-555-4321")
Rule allCus = { cus1, cus2 }
Rule allPhones As List
For Each C In allCus
allPhones = allPhones + {c.phone}
Next C
End Rule
Sanjay-
Re: run DLL
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Sanjay,
When evaluating allPhones, I get this error...
------------------------------------------
Error - vbclasslib.customer
------------------------------------------
Error Message:
vbclasslib.customer
Rule Stack:
Part: Root
Rule: cus1
Design: ViewWindow
Source:
Rule cus1 = New vbclasslib.customer("Jon", "Balgley", "503-555-1234")
Part: Root
Rule: allCus
Design: ViewWindow
Source:
Rule allCus = { cus1, cus2 }
Part: Root
Rule: allPhones
Design: ViewWindow
Source:
Rule allPhones As List
For Each C In allCus
allPhones = allPhones + {c.phone}
Next C
End Rule
Part: Root
Rule: %%EVAL_TEMP_1
Design: ViewWindow
Source:
Uncached Rule %%EVAL_TEMP_1 As Any = allPhones
------------------------------------------
Are there any other steps to follow prior to run a dll from ETO?
1- I closed Inventor
2- Copy the dll in the design files folder (of current project)
3- Restarted Inventor
4- ...
Re: run DLL
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Try this instead
Public Class Class1
Public Shared Function AddMyValues(ByVal Value1 As Double, ByVal Value2 As Double) As Double
Dim Result As Double
Result = Value1 + Value2
Return Result
End Function
End Class
************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Re: run DLL
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
If you don't want static methods in your .net code, you could get an instance in your intent code.
Rule myValuesAdded As Number
Dim instance As Any = New ClassLibrary1.Class1()
Return instance.AddMyValues(5, 2)
End Rule
************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************

