I’ve been experimenting with trying to pull information from code blocks for commonly used parameters to cut down on lines and extra nodes to visually clean up some scripts
Does anyone know why the examples below one works and the other doesn’t work?
Do you want to pull the batten depth parameter value from an element, not pull a value repeatedly? Asking as you can’t build a single definition which reads the value of another element in the graph and returns that value later on; it would need to pull the value from an input element each time (ie: move the Element.GetParameterValueByName function into the definition), as X isn’t defined in the context of the definition. Generally speaking it’s best to put the definitions into their own code blocks.
You can however define two actions, one which gets a parameter and writes to a file at a known location, and another which reads that file later on, but this is not very consistent or stable as you need to control execution sequence very carefully.
Hiding the wires from an early function call may be your best bet.
Yeah I think you’ve understood what I wanted. I guess its not full possible within the code yet. Ill look at hiding wires that might be the closest approach