CAM API
  • CAM API
v20.0.1
Search Results for

    Show / Hide Table of Contents

    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

    Namespace: STGeomApiTypes
    Assembly: STGeomApiTypes.dll
    Syntax
    [Guid("4EDB5F9A-A46C-4158-9C52-FAAA35E4CEA5")]
    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface ISGFMetaWriter

    Methods

    AddBolPair(string, bool)

    Declaration
    bool AddBolPair(string AKey, bool AValue)
    Parameters
    Type Name Description
    string AKey
    bool AValue
    Returns
    Type Description
    bool

    AddBolValue(bool)

    Declaration
    bool AddBolValue(bool AValue)
    Parameters
    Type Name Description
    bool AValue
    Returns
    Type Description
    bool

    AddFltPair(string, double)

    Declaration
    bool AddFltPair(string AKey, double AValue)
    Parameters
    Type Name Description
    string AKey
    double AValue
    Returns
    Type Description
    bool

    AddFltValue(double)

    Declaration
    bool AddFltValue(double AValue)
    Parameters
    Type Name Description
    double AValue
    Returns
    Type Description
    bool

    AddIntPair(string, int)

    Declaration
    bool AddIntPair(string AKey, int AValue)
    Parameters
    Type Name Description
    string AKey
    int AValue
    Returns
    Type Description
    bool

    AddIntValue(int)

    Declaration
    bool AddIntValue(int AValue)
    Parameters
    Type Name Description
    int AValue
    Returns
    Type Description
    bool

    AddStrPair(string, string)

    Declaration
    bool AddStrPair(string AKey, string AValue)
    Parameters
    Type Name Description
    string AKey
    string AValue
    Returns
    Type Description
    bool

    AddStrValue(string)

    Declaration
    bool AddStrValue(string AValue)
    Parameters
    Type Name Description
    string AValue
    Returns
    Type Description
    bool

    BeginArray(string)

    Begin a nested array with the given key.

    Declaration
    bool BeginArray(string ArrayID)
    Parameters
    Type Name Description
    string ArrayID
    Returns
    Type Description
    bool

    BeginObject(string)

    Begin a nested object with the given key.

    Declaration
    bool BeginObject(string ObjectID)
    Parameters
    Type Name Description
    string ObjectID
    Returns
    Type Description
    bool

    EndArray()

    Finish the current array.

    Declaration
    bool EndArray()
    Returns
    Type Description
    bool

    EndObject()

    Finish the current object.

    Declaration
    bool EndObject()
    Returns
    Type Description
    bool
    In this article