Hello, Bernd
I wrote the following function exporting WMF's from all graphics files created within a Project folder.
Mayby, this is an example for you and leads you the way to code your own stuff!
Happy coding ...
If there are questions, feel free to contact me
mailto:hans-joerg.koch@siemens.com
Hajo
void _exportWMF_Project_Folder()
{
PageBase gp;
// Create a Project object
Folder aktFld;
aktFld = Project.ActiveFolder();
string strPath="NULL";
strPath = BrowseGetPath(NULL, "Ausgabepfad fr WMF Export auswhlen");
if (strPath != "")
{
// Loop over all the pages in the project and display their names:
//progressBox aa("exportiere Grafiken nach WMF (gesamtes Projekt) ...");
int imax = 0;
int z = 0;
// Bestimmung von imax = Anzahl der Graph-Dateien im Projekt
foreach (gp in Project.ActiveFolder().Pages)
{
if (gp.GetType()==EXIST_PLOT)
{
imax++;
}
}
printf("Anzahl Grafiken %i\n", imax);
//aa.SetRange(0,imax);
foreach (gp in aktFld.Pages)
{
if (gp.GetType()==EXIST_PLOT)
{
//aa.Set(z++);
string strfname, strFldName;
// out_str(gp.GetName());
// Export der Grafiken durchfuehren
// Dateiname generieren:
// <Projektordner>_<GrafikObjekt-Label>.WMF
Folder fld;
fld = Project.GetFolderWithPage(gp.GetName());
fld.GetName(strFldName);
PageBase pb(gp.GetName());
strfname = strFldName + "_" + pb.label;
strfname.Replace(" ", "_");
gp.Show();
// Ausgabestring festlegen
strfname = strPath + strfname + ".WMF";
out_str(strfname);
string lt_str = "export.image(\""+strfname+"\", WMF)";
LT_execute(lt_str);
}
}
printf("WMF-Export von %i Dateien abgeschossen", imax);
}
else
{
MessageBox( NULL, "WMF-Export abgebrochen!", "Warning!", MB_ICONEXCLAMATION | MB_OK | MB_APPLMODAL)
}
}
mailto:hans-joerg.koch@siemens.com
-- --
Dipl.-Ing. Hans-Joerg Koch
Siemens VDO, Regensburg
SVDO_Origin1