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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #2
    You have to add INTEROP.PCDLRN.DLL (in your PC-DMIS root install folder) as a reference/resource and you can use the Object Editor (in visual studio) to explore the various methods.

    Comment


    • #3
      Originally posted by JacobCheverie View Post
      You have to add INTEROP.PCDLRN.DLL (in your PC-DMIS root install folder) as a reference/resource and you can use the Object Editor (in visual studio) to explore the various methods.
      Could you please provide some detailed tutorials? Any documents? It's hard to start by reading the Object Editor (in visual studio) to explore the various methods.

      Thanks,
      Xavier

      Comment


      • #4
        What version of PC-DMIS are you running? Go to C:\Program Files\Hexagon\***Your Version of PC-DMIS***\en and open "automationobjects.chm". That should give you a starting point in learning the various objects/methods/events. Then it'll be up to your imagination and your skills in C# for the most part.

        Comment


        • #5
          PcDmis 2015.1 SP10 CAD++
          Global 7-10-7 DC800S

          Comment


          • #6
            Originally posted by JacobCheverie View Post
            What version of PC-DMIS are you running? Go to C:\Program Files\Hexagon\***Your Version of PC-DMIS***\en and open "automationobjects.chm". That should give you a starting point in learning the various objects/methods/events. Then it'll be up to your imagination and your skills in C# for the most part.
            I using 'PC-DMIS 2019 R1 64-bit', I could find the "automationobjects.chm".

            Comment


            • #7
              Code:
              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

              Comment

              Related Topics

              Collapse

              Working...
              X