Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

call a dll from a ilogic rule

4 REPLIES 4
Reply
Message 1 of 5
swordmaster
1672 Views, 4 Replies

call a dll from a ilogic rule

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

Inventor 2010 Certified Professional
4 REPLIES 4
Message 2 of 5
adam.nagy
in reply to: swordmaster

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
swordmaster
in reply to: swordmaster

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 🙂

 

Inventor 2010 Certified Professional
Message 4 of 5
MaheshwarMD
in reply to: adam.nagy

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.

Mahesh
Message 5 of 5
MrKy.Net
in reply to: MaheshwarMD

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

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

Post to forums  

Autodesk Design & Make Report