Hi All!
I’m just playing around with Dynamo and trying to save some time changing sheet parameters values.
Everything works fine - I can change Identity Data of all sheets in seconds, but I would like to make some additional changes and make this work even better.
As I mentioned before, I can change Identity Data parameter values on ALL SHEETS within my project. It is okay, if I am the only one who is working on the project. But if there is one more person who is creating sheets and changing Identity Data, with this script I’ll overwrite data.
So what I would like to achieve? There suppose to be 2 options (using boolean’s true/false) and It would be ideal to make this script work like that :
1)If parameter (let’s say ‘Approved By’ ) of the sheet’s Identity Data is “empty” or default (‘Approver’), write data as entered in the string. If not - keep the parameter value as is and write data as entered just in empty or default fields.
2)Overwrite all parameters with data entered in the string.
Maybe someone can help me to sort this out? Thanks.
Hi Sorin,
Thank you for your message. I’ve tried exactly as shown but an error appears and this is not working properly. Any thoughts?
And where SetParameterBYName suppose to be connected with?
My apologies, the issue is with the OR node, if you replace it with the || node it should work, the OR node does not accept list inputs.
As the set parameter it should be connected to the OUT of the bool mask node
We are almost there.
I guess we need to add one more value in our code block because when I running the script, it is not changing empty fields. It is just searching for default value “Approver” and changing it. You know what I mean?
IS that allowed to use List.Create for that? In between Code block and String Contains. In that case the script will look for default values and empty fields and change with my selected input.
exchange the bottom part of the script with this, also replace the == node with || or else it does not work.
Here it is, just input the list of sheets you need and the value you want in the string node
test.dyn (17.7 KB)
It seems like I’m using different version of Dynamo so I can’t even open it. It says: Error opening corrupted file.
I am using dynamo 2 but it should work with earlier versions as well
That’s weird. It is working in reverse right know. It is keeping default and empty values as are and overwriting an existing value.
I’m not sure if this is a professional idea, but after some changes it worked. I’ve added “not” node to make it work in reverse.
1 Like
So finally, the first option from my question at the very beginning works fine. Thank you, Sorin.
My biggest concern right know is how to make the second option work.
What I’m trying to do - create an option in between two scripts.
Let’s say if boolean is TRUE - run this script, if FALSE - run another one.
I was thinking that the best option to do so is to use IF statement. But I’m not actually sure where it suppose to be.
The FALSE scenario we already finished earlier. The TRUE scenario suppose to be the script in the very beginning where my question is.
So in this case, if my Boolean is TRUE, I would like to overwrite all the Identity Data parameters of my sheets within my project.
Is there a way to split these scripts with TRUE/FALSE and IF statement?
@zalgirietis.minde
Hi there,
So from what i understand, you wish to set certain sheet parameters (checked by, approved by) etc to your own specific values IF the current value is Blank OR is the default value, such as “Checker” ?
And if it’s already been filled in with other information (by someone else working on the same project file) then you just want to leave it as it is to avoid overwriting data someone else has entered?
If I’ve understood correctly then please take a look at this .dyn I’ve just put together:
SheetParametersUpdaterV2.dyn (23.1 KB)
Screenshot of Workflow:
Brief Explanation
- All sheet elements are gathered
- Specific Parameters are obtained (“Drawn By”, “Checked By”, “Designed By” + "Approved By)
- The gathered parameter values are passed into the central code block which looks for blank or default values of the given parameters.
- If a value is blank or default then values from the Orange group will be used instead (edit these as you wish).
- If a value is NOT blank or default then the value is kept the same.
So, the only input required is to set the default parameter values you want to apply (Orange node group).
Note: I have hidden connectors for clarity of the screenshot above. To re-enable connectors just go to View - Connectors - Show Connectors.
QUICK EXAMPLE:
Before Dynamo RUN
My defaults:
After Dynamo RUN
Hopefully this has helped?
All the best,
Jack.
2 Likes
Instead of adding the NOT node you can use the In output of the BoolMask node instead of the out and it should work as you wanted, check the last picture i added with the whole graph again.
1 Like
Yes, this is exactly what I’m trying to achieve. Actually, what we already achieved with Sorin_T.
I’ll take a look at your .dyn and let you know how it goes. Thank you for explanation. It helps me to understand who does what.
So the thing I don’t really understand is how to combine two functions. Let me explain that:
I would like to use boolean mask that user can choose what he wants to do with the Identity Data.
It would work like that:
IF the boolean value is TRUE (All the Identity Data will be replaced with the one I will enter in the field or will be removed if the imput field is empty). If FALSE - just do exactly what you explained in your comment: set certain sheet parameters (checked by, approved by) etc to your own specific values IF the current value is Blank OR is the default value, such as “Checker”
In Dynamo Player it suppose to look like that:
Thanks, Sorin I’ll try to play with it.
Hello @zalgirietis.minde
I believe i have now produced exactly what you’re looking for.
Check this .dyn out:
SheetParametersUpdaterV5.dyn (50.7 KB)
Screenshot:
Dynamo Player Preview:
Brief Explanation:
I have updated the workflow to work best/easiest with Dynamo Player.
The first option is the “Override Method”
Setting this to True will Change all of the sheet data to the values you provide as the inputs,
Setting this to False will Only change the sheet data of values that were previously empty or were default values such as “Checker” or “Designer”.
The next 4 boxes are your inputs for “Drawn by”, “Checked by”, “Designed by” + “Approved by”.
The remaining boxes that appear grey, as per the screenshot above, are the output boxes which will update after you’ve run the workflow.
These boxes will first list all of the sheets affected by the workflow (in order of sheet number) and then indicate the “Original” values & the “Updated” values (Again, ordered by sheet number from the first output list). I thought i’d add this so you can see clearly what’s changed.
Please give this a try and let me know if there’s anything i’ve not understood!
If this workflow has provided an acceptable solution then i’d be grateful if you could mark this post as the “Solution”.
Thanks!
Jack.
2 Likes
@luckysurfcs ,
Well done! That’s an incredible work. Works fine and exactly what I was looking for. It seems like it was super easy for you. Isn’t it?
I think I need to work even more harder if I want to understand how all the scripts in dynamo works.
Thank you once again. I’ll mark your comment as solution.
Cheers!
@zalgirietis.minde
Great to hear. Glad this is an acceptable solution. I’m slowing learning Dynamo myself so problem-solving forum requests like this help me a lot as well
Thanks,
Jack.
1 Like