Hello There,
I have written a multi-value parameter code populating a few things in the custom i-properties. The rule runs well and fine when created inside a part and it populates the custom i-property as well. However, it throws an error when ran as an external rule. The error definition is stated below :
"Error in rule: Section Code, in document: Solid27.ipt
Object reference not set to an instance of an object."
Can anyone help me with this.
Thanks in advance.
Hi Aman,
Would it be possible to copy and paste your code here so that i can have a look?
That sort of error is relatively easy to fix, but i won't know exactly where it is without seeing it
Lewis Young
Windows 7 x64 - 32GB Ram
Intel Xeon E5-1620 v2 @ 3.70GHz
nVidia Quadro M2000 - 4GB
Inventor Professional 2017.3
Vault Basic 2017
3ds Max 2018
MultiValue.SetList("SectionCode", "CHS", "CONE", "PL", "WBEAD")
Parameter("SectionCode") = SectionCode
iProperties.Value("Custom", "Section-Code") = SectionCode
If SectionCode = "CHS" Then
MultiValue.SetList("CHS", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
Parameter("CHS") = CHS
iProperties.Value("Custom", "Section Type") = CHS
Else If SectionCode = "CONE" Then
MultiValue.SetList("CONE", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
Parameter("CONE") = CONE
iProperties.Value("Custom", "Section Type") = CONE
Else If SectionCode = "PL" Then
MultiValue.SetList("PL", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
Parameter("PL") = PL
iProperties.Value("Custom", "Section Type") = PL
Else If SectionCode = "WBEAD" Then
MultiValue.SetList("WBEAD", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
Parameter("WBEAD") = WBEAD
iProperties.Value("Custom", "Section Type") = WBEAD
End IF
iLogicVb.UpdateWhenDone = True
"THE CODE WORKS WHEN RUN WITHIN THE PART BUT FAILS WHEN RUN AS AN EXTERNAL RULE"
MultiValue.SetList("SectionCode", "CHS", "CONE", "PL", "WBEAD")
Parameter("SectionCode") = SectionCode
iProperties.Value("Custom", "Section-Code") = SectionCode
If SectionCode = "CHS" Then
MultiValue.SetList("CHS", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
Parameter("CHS") = CHS
iProperties.Value("Custom", "Section Type") = CHS
Else If SectionCode = "CONE" Then
MultiValue.SetList("CONE", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
Parameter("CONE") = CONE
iProperties.Value("Custom", "Section Type") = CONE
Else If SectionCode = "PL" Then
MultiValue.SetList("PL", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
Parameter("PL") = PL
iProperties.Value("Custom", "Section Type") = PL
Else If SectionCode = "WBEAD" Then
MultiValue.SetList("WBEAD", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
Parameter("WBEAD") = WBEAD
iProperties.Value("Custom", "Section Type") = WBEAD
End IF
iLogicVb.UpdateWhenDone = True
Here is the code. Thanks
Can't find what you're looking for? Ask the community or share your knowledge.