Interface ISGFMetaWriter
JSON-writer for the SGF header metadata (a subset of a JSON builder).
The filer owns the root JSON object; the producer just adds key/value pairs
and nested objects/arrays into it.
Recommended (extensible) keys:
originalFileName : string (source CAD file path)
sourceApp : { name, processFileName, version } (producer application)
toolbarLibrary : { name, path, version }
The "_generated" object (timeUTC, library, processFileName) is filled automatically
by the library in CloseFile - do NOT write it.
IMPORTANT: the header is valid only between StartFile and CloseFile. Get it via
(filer as ISTGeomReceiver).Header after StartFile; outside that window Header is nil.
Metadata is serialized into the file by CloseFile.
Write example (Delphi):
filer.StartFile(FileName); // from here Header is valid
rec := filer as ISTGeomReceiver;
mw := rec.Header.MetaWriter;
mw.AddStrPair('originalFileName', 'part.step');
mw.BeginObject('sourceApp');
mw.AddStrPair('name', 'MyExporter');
mw.AddStrPair('processFileName', 'C:\Apps\MyExporter.exe');
mw.AddStrPair('version', '3.2.1');
mw.EndObject;
rec.StartModel; // geometry (unchanged)
// ... geometry commands ...
rec.CloseModel;
filer.CloseFile; // writes header + commands; after this Header is nil
Assembly: STGeomApiTypes.dll
[Guid("4EDB5F9A-A46C-4158-9C52-FAAA35E4CEA5")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ISGFMetaWriter
Methods
Declaration
bool AddBolPair(string AKey, bool AValue)
Parameters
Returns
Declaration
bool AddBolValue(bool AValue)
Parameters
| Type |
Name |
Description |
| bool |
AValue |
|
Returns
Declaration
bool AddFltPair(string AKey, double AValue)
Parameters
Returns
Declaration
bool AddFltValue(double AValue)
Parameters
| Type |
Name |
Description |
| double |
AValue |
|
Returns
Declaration
bool AddIntPair(string AKey, int AValue)
Parameters
Returns
Declaration
bool AddIntValue(int AValue)
Parameters
| Type |
Name |
Description |
| int |
AValue |
|
Returns
Declaration
bool AddStrPair(string AKey, string AValue)
Parameters
Returns
Declaration
bool AddStrValue(string AValue)
Parameters
| Type |
Name |
Description |
| string |
AValue |
|
Returns
Begin a nested array with the given key.
Declaration
bool BeginArray(string ArrayID)
Parameters
| Type |
Name |
Description |
| string |
ArrayID |
|
Returns
Begin a nested object with the given key.
Declaration
bool BeginObject(string ObjectID)
Parameters
| Type |
Name |
Description |
| string |
ObjectID |
|
Returns
Finish the current array.
Declaration
Returns
Finish the current object.
Declaration
Returns