hexagon logo

Creating Writelines for Points in a Program

I'm fairly new to CMM programming and PC-DMIS so go easy on me. I do not have much experience with writing code but after reading through this forum it appears that you can do a lot to automate some of the things I have to do within my programs. The program I'm working with now requires that I create a Writeline for each point taken within the program to write the Point name along with the Nominal XYZ IJK and Measured XYZ values to a text file. This is very tedious so I thought I ask about creating a script to do this for me.

The writeline currently looks like this where IP_1000 is the ID for the vector point. The script would have to create a writeline like this at the end of the program for each point.

FILE/WRITELINE,F1,"IP_1000"+" , "+IP_1000.X+" , "+IP_1000.Y+" , "+IP_1000.Z+" , "+IP_1000.TI+" , "+IP_1000.TJ+" , "+IP_1000.TK+" , "+IP_1000.TX+" , "+IP_1000.TY+" , "+IP_1000.TZ

Thanks in advance for any help you can offer.
Parents
  • Another option
    In the editor window


    YOU WOULD NEED TO PHYSICALLY COUNT ALL THE VECTOR POINTS!!!!!

    (Ex. You have 416 vpoints)


    ASSIGN/COUNT = 0
    
    DO/
    ASSIGN/COUNT = COUNT + 1
    
    ASSIGN/V1 = GETCOMMAND("602","TOP",COUNT)
    
    ASSIGN/VPNT_NAME = GETTEXT("ID",1,V1)
    
    ASSIGN/MX = GETTEXT("MEASURED X",0,V1)
    ASSIGN/MY = GETTEXT("MEASURED Y",0,V1)
    ASSIGN/MZ = GETTEXT("MEASURED Z",0,V1)
    
    ASSIGN/TI = GETTEXT("THEORETICAL I",1,V1)
    ASSIGN/TJ = GETTEXT("THEORETICAL J",1,V1)
    ASSIGN/TK = GETTEXT("THEORETICAL K",1,V1)
    
    ASSIGN/TX = GETTEXT("THEORETICAL X",1,V1)
    ASSIGN/TY = GETTEXT("THEORETICAL Y",1,V1)
    ASSIGN/TZ = GETTEXT("THEORETICAL Z",1,V1)
    
    (Your file writeline would go here using the above variables)
    
    UNTIL/COUNT>415
    
    




    If I wanted to use this method but only output vector points that begin with IP_ is that possible or would that required a VB script?

    Thanks for all your help!
Reply
  • Another option
    In the editor window


    YOU WOULD NEED TO PHYSICALLY COUNT ALL THE VECTOR POINTS!!!!!

    (Ex. You have 416 vpoints)


    ASSIGN/COUNT = 0
    
    DO/
    ASSIGN/COUNT = COUNT + 1
    
    ASSIGN/V1 = GETCOMMAND("602","TOP",COUNT)
    
    ASSIGN/VPNT_NAME = GETTEXT("ID",1,V1)
    
    ASSIGN/MX = GETTEXT("MEASURED X",0,V1)
    ASSIGN/MY = GETTEXT("MEASURED Y",0,V1)
    ASSIGN/MZ = GETTEXT("MEASURED Z",0,V1)
    
    ASSIGN/TI = GETTEXT("THEORETICAL I",1,V1)
    ASSIGN/TJ = GETTEXT("THEORETICAL J",1,V1)
    ASSIGN/TK = GETTEXT("THEORETICAL K",1,V1)
    
    ASSIGN/TX = GETTEXT("THEORETICAL X",1,V1)
    ASSIGN/TY = GETTEXT("THEORETICAL Y",1,V1)
    ASSIGN/TZ = GETTEXT("THEORETICAL Z",1,V1)
    
    (Your file writeline would go here using the above variables)
    
    UNTIL/COUNT>415
    
    




    If I wanted to use this method but only output vector points that begin with IP_ is that possible or would that required a VB script?

    Thanks for all your help!
Children
No Data