I proberbly make a smal mistake in my code can someone correct me and explain what i do wrong here.
We have two type of pumps a big one and smal one ( Groot & Klein in dutch )
I have an form where i can enter Groot or Klein with an Drop down menu this works fine!
Now i need the shaft of the pump to extend 10mm when its a small pump.
I used the Part from the content center and i also made it extend en retract whenever the pump gets longer or shorter, this also works fine! Now i need to ad an aditional 10mm when the form is set to "short"
The parameter "Aslengte:" = parameter "Length:" + 185 + 62
"Length:" is filled in on the form
I do this because i wil remember how much the shaft goes into the head and the pump itself.
Solved! Go to Solution.
Solved by Mathias_CompC. Go to Solution.
I also tryd this:
If Pomp: "Groot" Then Parameter("EN 10060 - 35", "B_L") = AslengteGroot: End If If Pomp: "Klein" Then Parameter("EN 10060 - 35", "B_L") = AslengteKlein: End If
First I got quite confused by the presence of ':' in your code, then I realized you have it in the name of your parameter.
Have you tried something along the lines of:
If Parameter("Pomp:") = "Groot" Then
Parameter("EN 10060 - 35", "B_L") = Parameter("Length:") + 247
Else
Parameter("EN 10060 - 35", "B_L") = Parameter("Length:") + 257
End If
thankyou, it worked!
AslengteGroot:
because this was blue i already tought i had the parameter selected.
Happy to help. 🙂
You sort-of had a reference to the parameter, just not explicitly the value of it.
As a rule-of-thumb, anything not a-Z or '_' is wibbly-wobbly to reference as anything other than a string (" here "). And ':' especially, since something like
Label1:
'do stuff
Label2:
'OtherStuff
is actually a way to navigate code.
So, even if you could/would reference "AslengteGroot:" that way, if you ever tried assigning it's value like that, and your settings and syntax was just right, it would be treated as a label (an address in the code) and your result would be more funny than correct.
Can't find what you're looking for? Ask the community or share your knowledge.