Inventor Engineer-to-Order

Reply
Distinguished Contributor
ludesroc
Posts: 171
Registered: ‎05-03-2005
Message 1 of 5 (150 Views)

run DLL

150 Views, 4 Replies
12-20-2012 11:30 AM

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,

Ludesroc
Board Manager
sanjay.ramaswamy
Posts: 110
Registered: ‎11-13-2007
Message 2 of 5 (148 Views)

Re: run DLL

12-20-2012 12:19 PM in reply to: ludesroc

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-

Distinguished Contributor
ludesroc
Posts: 171
Registered: ‎05-03-2005
Message 3 of 5 (142 Views)

Re: run DLL

12-20-2012 12:45 PM in reply to: sanjay.ramaswamy

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- ...

Ludesroc
Mentor
FarrenYoung
Posts: 264
Registered: ‎07-13-2009
Message 4 of 5 (134 Views)

Re: run DLL

12-20-2012 02:02 PM in reply to: ludesroc

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

--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Mentor
FarrenYoung
Posts: 264
Registered: ‎07-13-2009
Message 5 of 5 (131 Views)

Re: run DLL

12-20-2012 02:07 PM in reply to: ludesroc

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

--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.