How to fix this error in python script?

Hello, I am a beginner in python scripts and I got an error in this script. Could you please help me to solve this error? Best Regards

Hi, I’m not quite sure what you’re trying to do, just by looking at it, seems like you’re missing some close parenthesis “)” at line 28 and also line 31 ?

In fact, I want to set parameter values so I took as input a list of selected items and a type of family.

In line 28, I want to set the parameter that is called “Numérotation palplanches” and give it the value of two successive numbers separated by spaces.

And in line 31, I did the same but the value that I gave to the^parameter is one number.

The parameter is of type string.

In line 27, the test is if the lement’s type is equal to the family type given as input.

Nicole,

You are missing parenthesis in those two lines like Xin has mentioned. Also, you are wrapping your OUT=0 into transaction calls. Why? There is no work being done when you declare a variable like that. As a matter of fact you have defined a method for what you want to achieve but you never actually call it. Once you get over the syntax issues makes sure to call that method and make sure that call is enclosed by transaction calls.

Thank you for your help, it worked.

Hi Nicole,

Other than what was already mentioned above, I see a few more possible issues with your code:

 

Consider forgoing scripting until you get a better feel for it and sticking to nodes for now. If I got the gist of it, the following graph should suffice nicely:

It completes exactly the same task without using any custom nodes or custom scripts …

Thank you Dimitar