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
  • ,

    That bat file technique is almost exactly what I am already doing using a VBA(I posted the code above)....I wasn't able to get the bat file technique to work b/c of the way our One drive is setup and where my python installation is. When I called up the bat file it kept saying an __init__ or something was not found meaning I think it was pulling up the wrong CMD or terminal that couldn't reference where my python files were....in fact I was getting this same error with every attempt to use VBA to start the python file until the version I am using above seemed to side step everything.

    I'll try the bat techinique again and report back the error message or success...I try not to bother out IT team b/c they don't really like us running scripts and such...even though I have over 10 working python scripts running alot of our CT scanning room all day long.

    I'm back in on Saturday, so I'll report back....I use txt files to export many variables for later use in python. That would be an acceptable way to go here, but I'd wonder if there was a direct way to get the variable...I was able to print a list of commands in python from pcdmis using a for loop, but if I remember when I tired to toss in an if stmt like:

    if cmd = 'C1':
    x = cmd

    if threw up an error like cmd was some strange windows object that wouldnt let itself be assigned to x. Anyway...I'll be in touch.
Reply
  • ,

    That bat file technique is almost exactly what I am already doing using a VBA(I posted the code above)....I wasn't able to get the bat file technique to work b/c of the way our One drive is setup and where my python installation is. When I called up the bat file it kept saying an __init__ or something was not found meaning I think it was pulling up the wrong CMD or terminal that couldn't reference where my python files were....in fact I was getting this same error with every attempt to use VBA to start the python file until the version I am using above seemed to side step everything.

    I'll try the bat techinique again and report back the error message or success...I try not to bother out IT team b/c they don't really like us running scripts and such...even though I have over 10 working python scripts running alot of our CT scanning room all day long.

    I'm back in on Saturday, so I'll report back....I use txt files to export many variables for later use in python. That would be an acceptable way to go here, but I'd wonder if there was a direct way to get the variable...I was able to print a list of commands in python from pcdmis using a for loop, but if I remember when I tired to toss in an if stmt like:

    if cmd = 'C1':
    x = cmd

    if threw up an error like cmd was some strange windows object that wouldnt let itself be assigned to x. Anyway...I'll be in touch.
Children
No Data