hexagon logo

How to open a python script in pcdmis?

I've got a couple basic scripts running on our programs and you simply go to INSERT > BASIC SCRIPT and chose the .bas file. But it won't let me choose a python file .py.
I tried external command and that doesn't work and I've tried INSERT > FILE I/O COMMAND > FILE OPEN, but when I run the program it runs the program without doing anything inside the python script.

How were those running some python scripts here actually getting pcdmis to open the python script?

Thanks.

Parents
  • Here is my latest issue...I'd like to get a variable from the CMM program so I can manipulate the data.

    The typical VBA code that does this isn't working with python:

    import win32com.client as w32
    dmisapp = w32.Dispatch('PCDLRN.Application')
    dmispart = dmisapp.ActivePartProgram
    dmiscommands = dmispart.Commands
    
    print(dmisapp.CurrentFolder) # Location of .PRG
    
    
    x = cmdcount = dmiscommands.Count
    print(x)
    
    y = dmispart.GetVariableValue ("CMM")
    print(y)
    
    input('Press any key to continue...')
    
    dmispart.RefreshPart()​
    


    Everything above is working except:
    y = dmispart.GetVariableValue ("CMM")

    any ideas how to get a specific variable from the CMM into python. I tried y = dmispart.GetVariableValue(CMM) and y = dmispart.GetVariableValue.CMM

    Thanks.
Reply
  • Here is my latest issue...I'd like to get a variable from the CMM program so I can manipulate the data.

    The typical VBA code that does this isn't working with python:

    import win32com.client as w32
    dmisapp = w32.Dispatch('PCDLRN.Application')
    dmispart = dmisapp.ActivePartProgram
    dmiscommands = dmispart.Commands
    
    print(dmisapp.CurrentFolder) # Location of .PRG
    
    
    x = cmdcount = dmiscommands.Count
    print(x)
    
    y = dmispart.GetVariableValue ("CMM")
    print(y)
    
    input('Press any key to continue...')
    
    dmispart.RefreshPart()​
    


    Everything above is working except:
    y = dmispart.GetVariableValue ("CMM")

    any ideas how to get a specific variable from the CMM into python. I tried y = dmispart.GetVariableValue(CMM) and y = dmispart.GetVariableValue.CMM

    Thanks.
Children
No Data