Your Products have been synced, click here to refresh
dim app as object set app = CreateObject("PCDLRN.Application")
// code to open pc-dmis, if pc-dmis is open, this c# application will connect to the currently running instance of PC-DMIS using PCDLRN; // class containing functions for interacting with pcdmis public class PCDMISInterop { Appliction pcdApp; // don't use IAppliction, instances of interface types cannot be created, Interfaces can only be inherated public Application PCDMISApplication { get{return this.Application;} } public PCDMISInterop() { startPCDMIS(); } bool StartPCDMIS() { try { Type pcdObjType = Type.GetTypeFromProgID("PCDLRN.Application"); this.pcdApp = Activator.CreateInstance(pcdObjType); pcdApp.WaitUntilReady(60); return true; //pc-dmis started } catch { return false; // an error occured } } // Gets the active part program }
using PCDLRN; int main(void) { PCDMISInterop PCDMIS = new PCDMISInterop(); PartProgram pcdProgram = PCDMIS.PCDMISApplication.ActivePartProgram // the following 2 methods could be put into the PCDMISInterop Class to simplify the coding. // to open a part program PCDMIS.PCDMISApplication.PartPrograms.Open("C:\test.prg","CMM1"); // "CMM1" for online, "OFFLINE" for offline // to create a new part program PCDMIS.PCDMISApplication.PartPrograms.Add("C:\test2.prg",UNITTYPE.INCH/*UNITTYPE.MM for metric*/,"TESTPROBE"); }
dim app as object set app = CreateObject("PCDLRN.Application")
// code to open pc-dmis, if pc-dmis is open, this c# application will connect to the currently running instance of PC-DMIS using PCDLRN; // class containing functions for interacting with pcdmis public class PCDMISInterop { Appliction pcdApp; // don't use IAppliction, instances of interface types cannot be created, Interfaces can only be inherated public Application PCDMISApplication { get{return this.Application;} } public PCDMISInterop() { startPCDMIS(); } bool StartPCDMIS() { try { Type pcdObjType = Type.GetTypeFromProgID("PCDLRN.Application"); this.pcdApp = Activator.CreateInstance(pcdObjType); pcdApp.WaitUntilReady(60); return true; //pc-dmis started } catch { return false; // an error occured } } // Gets the active part program }
using PCDLRN; int main(void) { PCDMISInterop PCDMIS = new PCDMISInterop(); PartProgram pcdProgram = PCDMIS.PCDMISApplication.ActivePartProgram // the following 2 methods could be put into the PCDMISInterop Class to simplify the coding. // to open a part program PCDMIS.PCDMISApplication.PartPrograms.Open("C:\test.prg","CMM1"); // "CMM1" for online, "OFFLINE" for offline // to create a new part program PCDMIS.PCDMISApplication.PartPrograms.Add("C:\test2.prg",UNITTYPE.INCH/*UNITTYPE.MM for metric*/,"TESTPROBE"); }
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |