hexagon logo

Where's the tutorial of using c# to read pc-dmis file(.prg)?

I'm new to secondary development of pc-dmis. There's only a little tutorials for it. Could anyone provide some tutorials about using c# to do it?
Parents
  • App = new PCDLRN.Application();//this works pc-dmis is open
    App.Visible = true;//pc-dmis is visible
    App.SetActive();
    
    IPartPrograms PCDPrograms =App.PartPrograms;
    
    //Opens base program
    IPartProgram pgm = PCDPrograms.Open("I:\\CMM - 4.5.4 SF\\Programs\\Injection - Keyed.PRG", "CMM1");//open a program
    richTextBox1.Text += "Program Opened \n";
    
    //Saves as new parts part number
    
    bool didSave = pgm.SaveAs("I:\\CMM - 4.5.4 SF\\TestPrograms\\HP0375-TEST.PRG"); //save as at location
    if (didSave)
    {
    richTextBox1.Text += "Saved as HP0377-TEST \n";
    }
    else
    {
    richTextBox1.Text += "Error saving \n";
    }
    
    //Imports cad at file path
    pgm.Import("Z:\\CNC_Programing\\Powershape\\Cavity _Tops\\Models\\HP0375.step"); //imports cad at file location
    
    pgm.Save(); //saves file
    
    
Reply
  • App = new PCDLRN.Application();//this works pc-dmis is open
    App.Visible = true;//pc-dmis is visible
    App.SetActive();
    
    IPartPrograms PCDPrograms =App.PartPrograms;
    
    //Opens base program
    IPartProgram pgm = PCDPrograms.Open("I:\\CMM - 4.5.4 SF\\Programs\\Injection - Keyed.PRG", "CMM1");//open a program
    richTextBox1.Text += "Program Opened \n";
    
    //Saves as new parts part number
    
    bool didSave = pgm.SaveAs("I:\\CMM - 4.5.4 SF\\TestPrograms\\HP0375-TEST.PRG"); //save as at location
    if (didSave)
    {
    richTextBox1.Text += "Saved as HP0377-TEST \n";
    }
    else
    {
    richTextBox1.Text += "Error saving \n";
    }
    
    //Imports cad at file path
    pgm.Import("Z:\\CNC_Programing\\Powershape\\Cavity _Tops\\Models\\HP0375.step"); //imports cad at file location
    
    pgm.Save(); //saves file
    
    
Children
No Data