cancel
Showing results for 
Search instead for 
Did you mean: 

Post Builder - Comment Formatting

Experimenter
Experimenter

I am trying to pass some variables to other software using comments at the begining of the program. Here is an example:

( MTRLX = "2.000" )
( MTRLY = "3.725" )

 

The trouble I am having is getting the value in quotations.  So far this is what I have:

if {[info exists mom_attr_PROGRAMVIEW_MTRLX]} {
MOM_output_literal "( MTRLX = $mom_attr_PROGRAMVIEW_MTRLX )"
} else {
MOM_output_literal "( MTRLX = N/A )"
}
if {[info exists mom_attr_PROGRAMVIEW_MTRLY]} {
MOM_output_literal "( MTRLY = $mom_attr_PROGRAMVIEW_MTRLY )"
} else {
MOM_output_literal "( MTRLY = N/A )"
}

 

This is what it outputs:

 

( MTRLX = 2.000 )
( MTRLY = 3.725 )

 

This gets the right information except the values need to be in " ".

 

Any one have a solution?

 

 

1 REPLY

Re: Post Builder - Comment Formatting

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

You can use \ as escape character in Tcl

so with:

MOM_output_literal "( MTRLX = \"${mom_attr_PROGRAMVIEW_MTRLX}\" )"

you will get output:

( MTRLX = "2.000" )

 

Marek Pawlus, NCmatic

Production: NX 11.0.2
Development: C#, Tcl/Tk, CSE

Learn online





Solution Information