"Object variable or With block variable not set" Please help

"Object variable or With block variable not set" Please help

Anonymous
Not applicable
2,809 Views
5 Replies
Message 1 of 6

"Object variable or With block variable not set" Please help

Anonymous
Not applicable

I've attached the part and the iLogic code (separately as a text file)

 

I've used the same type of code in other functions in the same iLogic rule. If I uncomment virtually anything in the "Coupling" function, the error appears. I can't understand why it's throwing errors in one particular function. Help? (please ignore my message boxes -- it's what I use to verify that the code gets to particular places)

 

The text of the error message:

 

Error in rule: Water Manicode, in document: Water Manifold.ipt

Object variable or With block variable not set.

 

The text of the "More Info" on the error:

 

System.NullReferenceException: Object variable or With block variable not set.
at Microsoft.VisualBasic.CompilerServices.Symbols.Container..ctor(Object Instance)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
at LmiRuleScript.Coupling(Object SupplyAndReturn, Object CompassDirections)
at LmiRuleScript.SetCouplingDiameter()
at LmiRuleScript.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

0 Likes
Accepted solutions (1)
2,810 Views
5 Replies
Replies (5)
Message 2 of 6

Maxim-CADman77
Advisor
Advisor
Accepted solution

Seems like Coupling function does not support empty value of SupplyAndReturn variable. 

Adding either of the two strings:

 

SupplyAndReturn = "Supply"

or

SupplyAndReturn = "Return"

(you should know which one is correct for you)

 

just before the line 127 seems to fix your issue.

Please vote for Inventor-Idea Text Search within Option Names

Message 3 of 6

RoyWickrama_RWEI
Advisor
Advisor

Thanks for your posting.

When I run the rule in drawing (in the 1st-time running) I get the similar error message: but unable to fix by myself. Could you help. Sample files attached.

Message.png

 

 

Inventor 2019

Vault Professional 2019

0 Likes
Message 4 of 6

Maxim-CADman77
Advisor
Advisor

The IDW you've posted doesn't reference the IPT you've posted - it sks for Part1.IPT on Open.
If I use To Post.IPT instead of Part1.IPT and run the mentioned Rule (Btw there are 4 rules embedded in To Post.IDW) I get

ToPost.png

Then 3 more dialog boxes and no errors.

PS: I've used Inventor 2019 with Update 3

Please vote for Inventor-Idea Text Search within Option Names

Message 5 of 6

RoyWickrama_RWEI
Advisor
Advisor

Thanks for the reply. I tried past 1:00 am and rushed to post for help. I apologize for my mistake. I re-attach the documents: Please try to help me. - Thanks.

 

Roy Wickrama 

0 Likes
Message 6 of 6

Maxim-CADman77
Advisor
Advisor

First of all judging by your InvDoc iProps you are using Inventor 2019 build 136 (I'm using Inventor 2019 build 278)

Consider installing most recent Update 2019.3.

Sure you know everything about Inventor Updating but just in case see:

https://knowledge.autodesk.com/support/inventor-products/downloads/caas/downloads/content/inventor-2...

 

https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2019...

https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2019...

for more info.

 

There were definitely some improvements regarding iLogic between Build 136 and 278 which can lead to different behavior on your and my PC on the same dataset.

 

PS: You are supposed to make sure you are using software with all actual updates installed before starting to ask any questions on the forums.

Please vote for Inventor-Idea Text Search within Option Names

0 Likes