hexagon logo

Script to pull nominal and tols

I am attempting to have a script create a csv file for later use. What I would like is to gain the output_id, and for each respective axis it reports obtain the nom, ptol, mtol.
Currently I have modified some script and what I found is when I have a location/tp output the output_id appears with 0,0,0. Then in the next 'instance' the output_id = 0 and I get the appropriate nom, ptol, mtol value. Almost every other output style (in legacy) will pull the output_id, nom, ptol, mtol without a gap. Here is the code I am using so far:



For example the following output will appear as "LOC_FORM",0,0,0,,"5.4756","4.0000","0.002",,"0","5.0000","0":


I'd like it to be: "LOC_FORM","5.4756","4.0000","0.002","LOC_FORM","0","5.0000","0"
TYIA