Yes No Parameter

Hello everybody,

i am using that very famous graph to create new sheets from an excel file and have now trouble with yes/no parameters… I am using Element.SetParameterByName as my last node, the element would be the sheet, the ParameterName would be B1 for example, and I thought the value could work with 0 or 1 (for no and yes). That was obviously not a great idea though and didnt work… How can one deal with that?

Cheers!

That one can work with True/False parameter. Try to set Boolean up.

Hi @bialmeida

Did you get any errors? Possible to share screenshot of the graph with all previews on.

2 Likes

I did, Dynamo gives me a “no parameter found by that name” back.
This Parameters are not shared parameters, could it be the problem?
Thanks!

It works with not only boolean but also 0 and 1.

1 Like

I tried both 0/1 and true/false, none seems to work…
It also seems that dynamo doesnt even find the parameter, according to the warning

This is my graph, I use it to turn off a Yes/ No Shared Parameter by multiple keywords.




Turn off RoomScheduleVisibility GBA Multiple Keywords (Clockwork) v1.dyn (65.2 KB)

The problem is not 0,1 or boolean. I think maybe because of the parameter. Is the sheet already has the parameter? If not, it won’t work.

1 Like

thats what i suspect too… the sheet has this parameter as a type parameter, so its not in the project itself… does it only work for shared parameters perhaps?

It can work with Project Parameters, Family Parameters or Shared Parameters.

1 Like

LP5_Sheet.rfa (700 KB) Sheets_test.dyn (64.4 KB) Test_Sheets.xlsx (9.0 KB)

Does someone have an idea what i am doing wrong here? Thanks!

The parameters i am trying to set are B1 to B6. Cheers!

I assume you mean the title block here. You can only set type parameters for family types, not family instances. Make sure you get the family type from the title block instance in order to set the type parameter.

1 Like

Hi @bialmeida,

As @Nick_Boyts says, you need to get the type of the title block instance in order to set a Type Parameter. You can use the Element.ElementType node (OOTB), but there are various costum nodes that will do this aswell. Which ever you prefer :-).

Another thing you need to be aware of, is that Yes/No parameters expect a numeric value of 0 or 1. The values might be numeric in the Excel Sheet, but you are reading the content of the Excel Sheet as strings when doing this:

So a couple of things to play around with, and then I’m sure you’ll get it to work :slight_smile:

1 Like

a bit complicated for beginners, sorry! i changed the boolean to false - thanks for that - and probably did something wrong getting the type…

You are trying to change the sheet parameter not those of the titleBloks
You can of course keep your organization, just add ʳʰʸᵗʰᵐ | Sheet.Titleblock after Sheet.ByNameNumberTitleBlockAndView

1 Like

Oh now i get the difference between sheets and title blocks - i was trying to add title block parameters to the sheet, thats why dynamo said the parameter doesnt exist… thanks! :woman_facepalming:

i am trying not to use packages as the office is quite big and its complicated to constantly install new things in hundreds of computers… I am a Python beginner as well, so i thought i could get the ID of the title blocks and then add the parameters to them - didnt help at all either :frowning: any other solution i could try here? Thank you very much!

@bialmeida
Since you can not have multiple numbers for a sheet,
you can proceed as follows:

1 Like

Genius! That works perfectly, thank you so very much!

Now a last question: my script shows an error after i run it for the first time and I understand why: dynamo is generating the sheet numbers and cant read them at the same time in order to get the titleblocks. After I run the graph for a second time everything works perfectly. Is there a way to avoid that second run? Something like determining that a part of the graph should run after the rest? Cheers and thanks again!