call a dll from a ilogic rule

call a dll from a ilogic rule

Anonymous
Not applicable
1,939 Views
4 Replies
Message 1 of 5

call a dll from a ilogic rule

Anonymous
Not applicable

okay, I created this  Public class and Public function  vb project

Public Class ClassNCupload

 

PublicFunction ncload(ByVal strNcName As String) AsString

Dim y AsNew WPNCTR.NCTRService

 

Dim result As String

Dim strErrDesc AsString = ""

Try

result = y.NCTransfer(strNcName, strErrDesc)

If result = "000"Then

MsgBox("NC upload successful")

 

Else

MsgBox("Error in WPNCTR - "& result & vbCrLf & strErrDesc)

 

EndIf

Catch ex AsException

MsgBox(ex.Message.ToString & vbCrLf & vbCrLf & ex.ToString)

Finally

EndTry

EndFunction

 

End Class

 

then compiled it as a dll NCupload.dll

 

This is a simplified version of my external rule

 

 

Add Reference "NCupload.dll

 

Sub Main

Dim strNcName As String

strNcName = "my string"

 

' now here i want to call the NCupload.dll , pass the value of strNcName to the dll and have it run

' anyone poin

 

End Sub

 

Can anyone explain how  i call the dll and pass the string variable value

 

thanks

0 Likes
1,940 Views
4 Replies
Replies (4)
Message 2 of 5

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

Here is a blog post which does the same:

http://adndevblog.typepad.com/manufacturing/2013/06/use-vbnet-dialog-in-ilogic.html

 

I hope this helps.

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 3 of 5

Anonymous
Not applicable

Adam, thanks for the link to the article it is very interesting.

Prior to seeing this I had a lot of help from Mike Deck at Autodesk and i can now successfully call my dll from the ilogic rule 🙂

 

0 Likes
Message 4 of 5

Anonymous
Not applicable

Hello,

 

I would like to know what is the function of "Class this reule" in inventor Ilogic.

Please let me know is there any sample tutorial on same.

0 Likes
Message 5 of 5

Anonymous
Not applicable

Hi Swordmaster
and Hi MaheshwarMD
I'm from the rule set used ilogic .dll file
But I have difficulties later
I've used the .dll file as a form
There currently are having problems are not used vb.net code dialog

Example simple as

dim a as double = 1
dim b as double = 2
dim c as double
c = a + b
msgbox (c) o

I can not Addreference in ilogic, because it does not contain the dialog as the instructions
Thanks

0 Likes