Variables

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Variables

    Hey all,

    I'm hoping some of the scripting gurus can help me out,

    In PC-DMIS i can do this.

    Code:
    FPTR       =FILE/OPEN,"TEXT.TXT",READ
                ASSIGN/COUNT=0
                WHILE/COUNT<10
    V1         =FILE/READLINE,FPTR,{XRD}+" "+{YRD}+" "+{ZRD}+" "+{IRD}+" "+{JRD}+" "+{KRD}
                ASSIGN/POINT[COUNT].TX=XRD
                ASSIGN/POINT[COUNT].TY=YRD
                ASSIGN/POINT[COUNT].TZ=ZRD
                ASSIGN/POINT[COUNT].TI=IRD
                ASSIGN/POINT[COUNT].TJ=JRD
                ASSIGN/POINT[COUNT].TK=KRD
                ASSIGN/COUNT=COUNT+1
                END_WHILE/
    if you test it, with the below code, you will see that it does in fact show the tx of point[8]
    Code:
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                POINT[8].TX

    this is fine, except while loops in pc-dmis seem to take forever. so if i have a file with 1000 points, the machine just sits while the points are read in.

    i would like to write a script to speed this process up.

    so far i've tried a few things

    Code:
    'in the pc-dmis program
    ASSIGN/POINT1.TX=.5
    
    'in the script: 
    
    sub main
    
        dim pcdApp as object
        dim pcdProg as Object
        set pcdApp = CreateObject("PCDLRN.Application")
        set pcdProg = pcdApp.ActivePartProgram
        dim v as object
        dim tx as object
        set v = pcdProg.GetVariableValue("POINT1")
        set tx = pcdProg.GetVariableValue("POINT1.TX")
        msgbox v.longvalue
        msgbox tx.longvalue
    end sub
    both of the msgbox's show a zero...

    any ideas?


    thanks in advance,

    -cappy

  • #2
    I have never been able to get .setvariablevalue to work as I expect it to. I have found that the PutText method works every time when the goal is to push a value into some parameter in PCDMIS. The variablevalue methods seem to be extremely sensitive to the value type and are only active during execution so you can't see the values that you pushed after execution has stopped. This makes debugging very annoying. If you look in the help file for .setvariablevalue it will give you some sample code (that might not actually work, if my memory is correct) and then it basically tells you to use .Puttext instead.
    2013MR1 SP6
    Global Frames, Tesastar-M Heads, LSP-X1M/H Probes

    Comment


    • #3
      Still on vacation, but have you tried DOUBLEVALUE instead of longvalue?
      PC-DMIS CAD++ 2o18 R2 SP5

      Comment


      • #4
        Vpt.se and I like the idea.You are using a long value, variable is 0.5, the wrong type.

        Comment


        • #5
          haha, that was probably it.

          Comment

          Related Topics

          Collapse

          Working...
          X