Hello.
I use Zenon 10 Build 162215, VisualStudio 2022 and Copa-Data Developer Tools 14.
It is a Wizard for Engineering Studio.
I need to export files in the Zenon Editor. I have this code:
- i_Anzahl = prj.FileManagement.GetFolder(FolderPath.Graphics).FileCount;
- for (i = 0; i < i_Anzahl; i++)
- {
- strZwischenspeicher = prj.FileManagement.GetFolder(FolderPath.Graphics).GetFileItem(i).Name;
- String strFilePath3 = Path.Combine(strFilePath1, strZwischenspeicher);
- strFilePath2 = Path.Combine(strPath, strZwischenspeicher);
- //How can I find out which EquipmentGroup the file is in?
- File.Copy(strFilePath3, strFilePath2);
- }
I only want to extract files, which belong to a certain equipment group. But I can not find any function to find it out.
With functions this is no problem:
- foreach (IFunction myFunction in prj.FunctionCollection)
- {
- strZwischenspeicher = myFunction.GetDynamicProperty("SystemModelGroup.SystemModelGroup").ToString();
- if (strZwischenspeicher.Contains(strEquipmentGroupID))
- {
- strFilePath1 = Path.Combine(strPath, myFunction.Name + ".xml");
- prj.FunctionCollection.ExportToXml(myFunction.Name, strFilePath1);
- }
- }