"[SOLVED] empty-string macro in Execute Process operator"
tennenrishin
New Altair Community Member
Answers
-
Hi Isaac,
no, that's currently not possible. If you really need it you could use the Generate Macro with the replace() function. I admit it's not the most elegant thing, but it works. Please see the attached process.
Best, Marius<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Oh, I just saw that you need it for Execute Process. That's not possible, however you could define a string representing "empty" and replace it with empty in the executed process with the above operators.
<process version="5.2.006">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.2.006" expanded="true" name="Process">
<process expanded="true" height="280" width="614">
<operator activated="true" class="set_macro" compatibility="5.2.006" expanded="true" height="76" name="Set Macro" width="90" x="179" y="30">
<parameter key="macro" value="x"/>
<parameter key="value" value="a"/>
</operator>
<operator activated="true" class="generate_macro" compatibility="5.2.006" expanded="true" height="76" name="Generate Macro" width="90" x="313" y="30">
<list key="function_descriptions">
<parameter key="x" value="replace("%{x}", "a", "")"/>
</list>
</operator>
<operator activated="true" class="print_to_console" compatibility="5.2.006" expanded="true" height="76" name="Print to Console" width="90" x="447" y="30">
<parameter key="log_value" value="x: "%{x}""/>
</operator>
<connect from_op="Set Macro" from_port="through 1" to_op="Generate Macro" to_port="through 1"/>
<connect from_op="Generate Macro" from_port="through 1" to_op="Print to Console" to_port="through 1"/>
<connect from_op="Print to Console" from_port="through 1" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>0