G
N
I
D
A
O
L

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

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

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?

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.

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,

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.

https://www.pcdmisforum.com/forum/pc-dmis-enterprise-metrology-software/pc-dmis-code-samples/22927-pcdmis-automation-with-visual-csharp-2010-express

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".

posted @ 2025-05-31 22:08  firespeed  阅读(26)  评论(0)    收藏  举报