hexagon logo

passing text in a comment to script variable?

Does anyone know how to pull the text out of a report comment feature and into a variable in the basic script editor?
Parents
  • SCN1       =FEAT/SET,CARTESIAN
                THEO/<-0.0099,-0.0142,4.4921>,<0,0,1>
                ACTL/<-0.0099,-0.0143,4.4919>,<0,0,1>
                CONSTR/SET,BASIC,P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20,P21,P22,P23,P24,,
                ASSIGN/V1=DOT((SCN1.HIT[1..24].XYZ-SCN1.HIT[1..24].TXYZ),SCN1.HIT[1..24].TIJK)
                ASSIGN/V2=(MAX(V1)-MIN(V1))/2
                COMMENT/REPT,
                "Overall tolerance range here is: " + V2



    Basically anything you can put into a report comment. This was just a quick example I used, but you get the idea. I have started using excel more and more to sort through data, and I know I can make excel do the calculation here, but it sure would be a nice addition to my 'toolbox' if I could pull those comments out of a program and print into a text file like I do with the rest of the data.

    Also, I had the idea that if I assigned another variable, like ASSIGN/V3="what I would want in my comment here", and then set the comment equal to the variable instead of how I have above, I could pull the value out of the variable instead of the comment as a different means to accomplish the same end. I don't know how to do that, either. I've looked through dozens of threads but I guess I'm not sure what to really look for.

    I am not very savvy when it comes to coding, so if you post a code snippet you think might work could you please explain what the code is doing (how it 'talks' to the program). Thanks.
Reply
  • SCN1       =FEAT/SET,CARTESIAN
                THEO/<-0.0099,-0.0142,4.4921>,<0,0,1>
                ACTL/<-0.0099,-0.0143,4.4919>,<0,0,1>
                CONSTR/SET,BASIC,P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20,P21,P22,P23,P24,,
                ASSIGN/V1=DOT((SCN1.HIT[1..24].XYZ-SCN1.HIT[1..24].TXYZ),SCN1.HIT[1..24].TIJK)
                ASSIGN/V2=(MAX(V1)-MIN(V1))/2
                COMMENT/REPT,
                "Overall tolerance range here is: " + V2



    Basically anything you can put into a report comment. This was just a quick example I used, but you get the idea. I have started using excel more and more to sort through data, and I know I can make excel do the calculation here, but it sure would be a nice addition to my 'toolbox' if I could pull those comments out of a program and print into a text file like I do with the rest of the data.

    Also, I had the idea that if I assigned another variable, like ASSIGN/V3="what I would want in my comment here", and then set the comment equal to the variable instead of how I have above, I could pull the value out of the variable instead of the comment as a different means to accomplish the same end. I don't know how to do that, either. I've looked through dozens of threads but I guess I'm not sure what to really look for.

    I am not very savvy when it comes to coding, so if you post a code snippet you think might work could you please explain what the code is doing (how it 'talks' to the program). Thanks.
Children
No Data