Inventor Engineer-To-Order (Read-Only)
Welcome to Autodesk’s Inventor ETO Forums. Share your knowledge, ask questions, and explore popular Inventor ETO topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 5
ludesroc
447 Views, 4 Replies

run DLL

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
4 REPLIES 4
Message 2 of 5
sanjay.ramaswamy
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-

Message 3 of 5
ludesroc
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
Message 4 of 5
FarrenYoung
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"
************************************************************************************
Message 5 of 5
FarrenYoung
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"
************************************************************************************

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report