
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All
I am new to the .net but have used iLogic for some time. I have tried to reference a sub inside a Class (dll file).
I have some parameters that I want to set from the dll.
Parameter "Lenght1" and "Width1" exist in the model file
I can call the sub and receive the msgBox but I cannot figure out how to set parameters from the dll through iLogic.
I get the following error message:
"Object reference not set to an instance of an object."
Can anyone help me with setting the parameters? Or point me in the right direction
See simplified example below:
'iLogic call
AddReference "System.Runtime" AddReference "C:\Vault\Designs\Testing\iLogic_VB\SubCall.dll" Parameter.UpdateAfterChange = True MultiValue.UpdateAfterChange = True iLogicVb.UpdateWhenDone = True Dim tool as New SubCall.ClassSubCall tool.Testing(UserAnswer) 'Yes or No tool.Parameter = Parameter tool.MultiValue = MultiValue tool.Length1 = Parameter("Length1") tool.Width1 = Parameter("Width1")
'dll file
Imports Autodesk.iLogic.Interfaces
Public Class ClassSubCall
Public Parameter As IParamDynamic
Public MultiValue As IMultiValueParam
Public ILogicVB As ILowLevelSupport
Public Length1 As Double
Public Width1 As Double
Public Sub Testing(ByVal UserAnswer As String)
If UserAnswer = "Yes" Then
MsgBox("OK, message received")
Parameter("Length1") = 100
Parameter("Width1") = 50
Else
MsgBox("No message received")
Parameter("Length1") = 150
Parameter("Width1") = Parameter("Length1") / 2
End If
End Sub
End Class
Solved! Go to Solution.