Your Products have been synced, click here to refresh
[COLOR=#454545][FONT=UICTFontTextStyleBody]Dim PCDApp, PCDPartPrograms, PCDPartProgram[/FONT][/COLOR][COLOR=#454545][FONT=UICTFontTextStyleBody] [/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]Set PCDApp = CreateObject("PCDLRN.Application")[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]Set PCDPartPrograms = PCDApp.PartPrograms[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] PCDApp.Visible = True[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] PCDPartPrograms.Open "Z:\test1.PRG", "CMM1"[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]Set PCDPartProgram = PCDApp.ActivePartProgram[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] 'msgbox "This will start the execution of the partprogram!"[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] PCDPartProgram.Execute[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] ' PC-DMIS executes the partprogram[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] PCDPartProgram.Close[/FONT][/COLOR][COLOR=#454545][FONT=UICTFontTextStyleBody] [/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] ' PC-DMIS closes and saves the partprogram[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]PCDPartPrograms.Open "Z:\test2.PRG", "CMM1"[/FONT][/COLOR][COLOR=#454545][FONT=UICTFontTextStyleBody] [/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]Set PCDPartProgram = PCDApp.ActivePartProgram[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] 'msgbox "This will start the execution of the partprogram!"[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] PCDPartProgram.Execute[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] ' PC-DMIS executes the partprogram[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] PCDPartProgram.Close[/FONT][/COLOR][COLOR=#454545][FONT=UICTFontTextStyleBody] [/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] ' PC-DMIS closes and saves the partprogram[/FONT][/COLOR][COLOR=#454545][FONT=UICTFontTextStyleBody] [/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]' Cleanup[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]Set PCDPartProgram = nothing[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]Set PCDPartPrograms = nothing[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]Set PCDApp = nothing [/FONT][/COLOR]
Basic Script
This might help.
[COLOR=#454545][FONT=UICTFontTextStyleBody]Dim PCDApp, PCDPartPrograms, PCDPartProgram[/FONT][/COLOR][COLOR=#454545][FONT=UICTFontTextStyleBody] [/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]Set PCDApp = CreateObject("PCDLRN.Application")[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]Set PCDPartPrograms = PCDApp.PartPrograms[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] PCDApp.Visible = True[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] PCDPartPrograms.Open "Z:\test1.PRG", "CMM1"[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]Set PCDPartProgram = PCDApp.ActivePartProgram[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] 'msgbox "This will start the execution of the partprogram!"[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] PCDPartProgram.Execute[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] ' PC-DMIS executes the partprogram[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] PCDPartProgram.Close[/FONT][/COLOR][COLOR=#454545][FONT=UICTFontTextStyleBody] [/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] ' PC-DMIS closes and saves the partprogram[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]PCDPartPrograms.Open "Z:\test2.PRG", "CMM1"[/FONT][/COLOR][COLOR=#454545][FONT=UICTFontTextStyleBody] [/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]Set PCDPartProgram = PCDApp.ActivePartProgram[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] 'msgbox "This will start the execution of the partprogram!"[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] PCDPartProgram.Execute[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] ' PC-DMIS executes the partprogram[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] PCDPartProgram.Close[/FONT][/COLOR][COLOR=#454545][FONT=UICTFontTextStyleBody] [/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody] ' PC-DMIS closes and saves the partprogram[/FONT][/COLOR][COLOR=#454545][FONT=UICTFontTextStyleBody] [/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]' Cleanup[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]Set PCDPartProgram = nothing[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]Set PCDPartPrograms = nothing[/FONT][/COLOR] [COLOR=#454545][FONT=UICTFontTextStyleBody]Set PCDApp = nothing [/FONT][/COLOR]
Maybe check if your machine is named "CMM1" and not anything else (I think the names differs between languages).
Dim CMM_Name,Msg CMM_Name = PCDDmisPart.ActiveMachine If CMM_Name = "CMM1" Then Set PCDDmisCommand = PCDDmisCommands.Add(ASSIGNMENT,True) PCDDmisCommand.Marked = True retval = PCDDmisCommand.PutText("CMM_NAME",DEST _EXPR,0) retval = PCDDmisCommand.PutText("STR(""CMM1"")",SRC_EXPR,0) End If
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |