hexagon logo

python development instances for pc-dmis.

import win32com.client as w32
dmisapp = w32.Dispatch('PCDLRN.Application')
dmispart = dmisapp.ActivePartProgram
dmiscommands = dmispart.Commands

def pc_dmis_report():
    for cmd in dmiscommands:
        if cmd.IsDimension and int(cmd.DimensionCommand.OutTol)==0:
            cmd.SetToggleString(3,165,0)
        else:
            cmd.SetToggleString(4,165,0)

pc_dmis_report()
dmispart.RefreshPart()
Parents
  • If you have multiple PC-DMIS versions installed, it may be a mismatch between "the last version run (or installed) with admin rights" and "the currently running version". All automation programs look in HKEY_CLASSES_ROOT\PCDLRN.Application\CLSID to see what to contact when you reference "PCDLRN.Application" in your program.

    Each time PC-DMIS is started (or installed), it tries to write its own CLSID there, but it will only succeed when running with admin rights. So if you have 2018 R1 installed, but run 2017 R2, everything will just hang for a long time when the script tries to start 2018 R1 (as the Registry has informed it), something which will not succeed while 2017 R2 is still running.

    Start the PC-DMIS version you want to use once with admin rights, exit, then in the normal way and see if it makes any difference.

    Alternatively, if you have the rights, change the access rights on HKEY_CLASSES_ROOT\PCDLRN.Application\CLSID so a normal user may change it (your IT department might want to have a say about that...).
Reply
  • If you have multiple PC-DMIS versions installed, it may be a mismatch between "the last version run (or installed) with admin rights" and "the currently running version". All automation programs look in HKEY_CLASSES_ROOT\PCDLRN.Application\CLSID to see what to contact when you reference "PCDLRN.Application" in your program.

    Each time PC-DMIS is started (or installed), it tries to write its own CLSID there, but it will only succeed when running with admin rights. So if you have 2018 R1 installed, but run 2017 R2, everything will just hang for a long time when the script tries to start 2018 R1 (as the Registry has informed it), something which will not succeed while 2017 R2 is still running.

    Start the PC-DMIS version you want to use once with admin rights, exit, then in the normal way and see if it makes any difference.

    Alternatively, if you have the rights, change the access rights on HKEY_CLASSES_ROOT\PCDLRN.Application\CLSID so a normal user may change it (your IT department might want to have a say about that...).
Children