SDK Help "Comment on this page" > DataIO.GetInputFormats() issues
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I tried to post this via the "comment on this page" link in the help documen,t but get this error from my mail client:
"DataIO_Overview >" is not a valid e-mail address because it is not of the form user@host. You must correct it before sending the e-mail.?? What´s up? How do i post correctly?
So for now I guess I´ll delegate my troubles to this forum instead:
Trying to use the provided code example implemented in C# on a Sheet object I seem to get a default array from sheet.DataIO.GetOutputFormats() & sheet.DataIO.GetInputFormats() throws a not implemented exception?
Another problem is the referenced variables. In C# you have to define the size of an array to initialize it, but there is no way to know what´s coming. Using an "out" argument instead of "ref" would be a much better scenario in this case as the referenced array doesn´t have to be initialized first, hence overcoming the problem of the unknown size of the output array.
Here´s my code: ( myInventor is the Application object )
Document myDoc = myInventor.ActiveDocument;
DrawingDocument myDraw = myDoc as DrawingDocument;
Sheet mySheet = myDraw.Sheets[1];
StorageTypeEnum[] myStore = new StorageTypeEnum[20];
string[] formats = new string[20];
mySheet.DataIO.GetOutputFormats(formats, myStore);
string output = "";
for(int i = 0; i < formats.Length; i++)
output = output + System.Environment.NewLine + formats[i] + " : " + myStore[i];
Console.Write(output);