Yes, in Rule 1, on the next line after your [d0 = ...] line of code, which sets the value of the d0 parameter, use that line of code I posted.
It is a bit difficult to explain, but there is a whole other Class block of code that seems to get auto-generated for our iLogic rules, which we never see. This is because the default Class named 'ThisRule' is a 'Partial' Class, and the hidden half seems like it may even be a bit dynamic, meaning depending on what we include in our regular rule, its contents may get changed to match the need. I believe this is partially to support what they call 'Rule Objects', which seem like variables that have already been assigned values, and usually represent some sort of Interface type object.
If you have ever looked at the text file that gets automatically created when we run an iLogic rule, within the [C:\Users\%user%\AppData\Local\Temp\iLogic Rules\ folder, you will notice some extra code in them that you did not include in your rule. And because of this, sometimes when you see an error message, and pay close attention to it, you may notice it mention a line number where the problem was encountered do not seem to match up with your expectation. It is because it is looking at that other version of the code. That temp file still does not include that whole other partial Class block of code, but it does include the hints about it, because it will automatically create that default 'ThisRule' Class, and enclose our regular code within it, if we did not create that Class ourselves, within our own code. It seems like there may be 3 versions of our rules...the portion that we write, the slightly altered version, like what we see in the temp file, then the whole rule that includes the other half of the 'ThisRule' Class block of code. Well, that line of code I showed you is for a special Sub routine that is defined within the other/hidden half of the 'ThisRule' Class block of code, and it is specifically for pushing the current values of those special, blue, 'iLogic parameters' to the model. And it only happens at the line of code where it is called to run. So, if you have a long rule with lots of progressive interactions with those special, blue, iLogic parameters, then you may need to use that special line of code in more than one place, depending on the situation, and how critical the changes / updates are to further code after that point. Other ways of interacting with Parameters do not seem to have anything to do with that special Sub routine. It is just something that help support their functionality within 'internal' iLogic rules.
You can also see this special line of code mentioned in the following online help documentation page, where it is talking about the standard iLogic Snippets for working with Parameters:
https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-6B4885C8-7E75-4FEA-8DEF-EA7D40F33EB3
...near the bottom of that page.

Wesley Crihfield

(Not an Autodesk Employee)