Your Products have been synced, click here to refresh
This code has not been extensively tested and I cannot be held responsible to any damages done by running the code. You run this on your own risk.
For starters, create a program that simply does nothing more than displays an operator comment with some text, just to see how/that it works. If you choose to include this in an production environment - then that is totally up to you. As always, tweak the code to your own liking.
It's more like a proof of concept than a complete solution - the customized solution is left for you to create.
Dim PCDApp, PCDPartPrograms, PCDPartProgram Set PCDApp = CreateObject("PCDLRN.Application") Set PCDPartPrograms = PCDApp.PartPrograms PCDApp.Visible = True PCDPartPrograms.Open "[COLOR="red"]Z:\test1.PRG[/COLOR]", "[COLOR="red"]CMM1[/COLOR]" Set PCDPartProgram = PCDApp.ActivePartProgram 'msgbox "This will start the execution of the partprogram!" PCDPartProgram.Execute ' PC-DMIS executes the partprogram PCDPartProgram.Close ' PC-DMIS closes and saves the partprogram PCDPartPrograms.Open "[COLOR="red"]Z:\test2.PRG[/COLOR]", "[COLOR="red"]CMM1[/COLOR]" Set PCDPartProgram = PCDApp.ActivePartProgram 'msgbox "This will start the execution of the partprogram!" PCDPartProgram.Execute ' PC-DMIS executes the partprogram PCDPartProgram.Close ' PC-DMIS closes and saves the partprogram ' Cleanup Set PCDPartProgram = nothing Set PCDPartPrograms = nothing Set PCDApp = nothing
Save this as 'starter.vbs'. Then edit the path to the partprogram to reflect the partprogram you wish to run. Change the CMM1 to whatever machine interface you want to use and save it.
Make sure PC-DMIS is running and then doubleclick the starter.vbs to start, execute and save/close the partprogram.
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |