Introduction

This chapter provides an alphabetical reference to the functions provided as extensions to the SDAI binding by this implementation. These functions provide functionality that is either missing from Part 22, or which could be implemented in using the operations defined by the specification, but would be very inconvenient or inefficient to do so.

_sdaiAddSchema()

void _sdaiAddSchema (
	SdaiModel mod,
	SdaiSchema sch
	);

The _sdaiAddSchema function adds a schema to the schema list of a model. This allows a model to reference multiple schemas (a non-standard SDAI feature).

_sdaiDisplay()

void _sdaiDisplay (
	SdaiInstance obj
	); 

The _sdaiDisplay() function displays a single instance on stdout.

_sdaiDisplayADB()

void _sdaiDisplayADB(
	SdaiADB adb
	);

The_sdaiDisplayADB() function displays an ADB on stdout.

_sdaiDisplayAggr()

void _sdaiDisplayAggr (
	SdaiAggr agg
	); 

The_sdaiDisplayAggr() function displays a single aggregate on stdout.

_sdaiDisplayModel()

void _sdaiDisplayModel(
	SdaiModel mod
	);

The _sdaiDisplayModel() function displays a model on stdout. This output could get extremely long on a large model.

_sdaiFindModelBN()

SdaiModel _sdaiFindModelBN (
	SdaiRep repository,
	SdaiString modelName 
	);

The _sdaiFindModelBN() extension function finds a model by name in a repository. This function is similar to sdaiAccessModelBN except that it does not generate an error is the model is already open for either read-only or read-write access.

Errors

    sdaiSS_NOPN    	session is not open  
    sdaiMO_NEXS    	NULL or invalid model
    sdaiRP_NOPN    	repository not open

See Also

sdaiAccessModelBN()

_sdaiGenerateFullDictionary()

void _sdaiGenerateFullDictionary (
	SdaiBoolean val
	);

The _sdaiGenerateFullDictionary() function sets an internal flag which determines whether the SDAI library will generate a complete dictionary model, or a simplified version. If the val parameter is sdaiTRUE, then the interface creates a complete dictionary; if val is sdaiFALSE, the interface does not generate a complete dictionary. By default, it does generate a complete dictionary.

See Also

_sdaiGetGenerateFullDictionary()

_sdaiGetAllAttrDefinitions ()

SdaiNPL _sdaiGetAllAttrDefinitions (
	SdaiEntity entity, 
	SdaiNPL resultList
	);

The _sdaiGetAllAttrDefinitions() function determines all the explicit attributes an entity has (both local and inherited), and places them in the non persistent list referred to by the resultList parameter.

Errors

    sdaiSS_NOPN - session not open
    sdaiED_NDEF - entity definition NULL or not defined
    sdaiAI_NEXS - NPL is not valid or NULL

_sdaiGetAggr()

SdaiAggr _sdaiGetAggr (
	RoseAggregate * obj
	);

The _sdaiGetAggr() function returns the SDAI aggregate associated with a ROSE objects. This function should only be used on persistent objects.

_sdaiGetAppInstance()

SdaiAppInstance _sdaiGetAppInstance (
	RoseStructure * obj
	); 

The _sdaiGetAppInstance() function returns the SDAI instance associated with a ROSE objects. This function should only be used on persistent objects.

_sdaiGetComplexEntityBN()

SdaiEntity _sdaiGetComplexEntityBN (
	SdaiModel model,
	SdaiInteger nameNumber,
	SdaiString *nameVector
	);

The _sdaiGetComplexEntityBN() function works just like the sdaiGetComplexEntityBN except that the model is specified by handle rather than by name.

Errors

    sdaiSS_NOPN    	session is not open 
    sdaiNO_NEXS    	NULL or invalid model 	
    sdaiED_NDEF    	entity not in EXPRESS

See Also

sdaiGetComplexEntityBN()

_sdaiGetDerivedAttrDefinitions()

SdaiNPL _sdaiGetDerivedAttrDefinitions (
	SdaiEntity entity,
	SdaiNPL list
	);

The _sdaiGetDerivedAttrDefinitions() function determines the derived attributes of an entity and places them into a user specified non-persistent list. This information can be determined be examining the dictionary, but this function provides a more efficient and convenient way to determine this information.

_sdaiGetDomainForEntity()

RoseDomain * _sdaiGetDomainForEntity (
	SdaiEntity ent
	);

The _sdaiGetDomainForEntity() function retrieves RoseDomain associated with a given SDAI entity_definition.

This function is only available to C++ applications, and <rose.h> must be included before <sdai.h>.

Errors

       sdaiSS_NOPN    		session not open  
       sdaiED_NDEF    		entity definition NULL or not defined	

See Also

_sdaiGetEntityForDomain()

_sdaiGetEntityForDomain()

SdaiEntity _sdaiGetEntityForDomain (
	RoseDomain * dom
	);

The _sdaiGetEntityForDomain() function retrieves the SDAI entity_definition associated with a specific RoseDomain.

This function is only available to C++ applications, and <rose.h> must be included before <sdai.h>.

See Also

_sdaiGetDomainForEntity()

_sdaiGetEntityId()

int _sdaiGetEntityId (
	SdaiAppInstance inst
	);

The _sdaiGetEntityId() function returns the entity ID from a Part 21 file. If the entity is not in a model that was read in from a Part 21 file, this function returns 0.

Example

    printf ("Have entity ID: %d\n", _sdaiGetEntityId(inst));

See Also

RoseObject::entity_id() in the Rose Library Reference Manual.

_sdaiGetEntityInModel()

SdaiEntity _sdaiGetEntityInModel(
	SdaiModel model,
	SdaiString name
	);

The _sdaiGetEntityInModel() extension function finds an entity_instance within a specific (dictionary) model. This function can be used to traverse the dictionary model, where there is no model based on the dictionary loaded.

Example

This example finds the definition for cartesian_point in the dictionary for Part 203.

    SdaiSchema sch;
    SdaiModel mod;
    SdaiEntity cart_pt_ent;
    sch = sdaiGetSchema ("config_control_design"); 
    mod = sdaigetInstanceModel (sch); 
    cart_pt_ent = _sdaiGetEntityInModel (mod, "cartesian_point");

See Also

sdaiGetEntity()

_sdaiGetErrorName()

SdaiString _sdaiGetErrorName(
	SdaiErrorCode code
	);

The sdaiGetErrorName() function returns the name of an SDAI error. This returns a string of the form "AI_NVLD". It may be helpful within error handling routines. This function returns a string containing the error code.

_sdaiGetExplcitAttrDefinitions()

SdaiNPL _sdaiGetExplicitAttrDefinitions (
	SdaiEntity entity,
	SdaiNPL list
	);

The _sdaiGetExplicitAttrDefinitions() function determines the explicit attributes of an entity and places them into a user specified non-persistent list. This information can be determined be examining the dictionary, but this function provides a more efficient and convenient way to determine this information.

_sdaiGetGenerateFullDictionary()

SdaiBoolean _sdaiGetGenerateFullDictionary ();

The _sdaiGetGenerateFullDictionary() function returns the value of the internal flag that is set by the _sdaiGenerateFullDictionary function. If true, the SDAI library attempts to generate a complete dictionary.

See Also

_sdaiGenerateFullDictionary()

_sdaiGetHeaderDescription()

int _sdaiGetHeaderDescription (
	SdaiModel mod
	);

The _sdaiGetHeaderDescription() function returns description instance from the STEP Part 21 file corresponding to the model. This instance may be queried to set the fields in the Part 21 file header, or its attributes may be changed to set the fields in the file header when the file is written out. Changes made to the header entities will only be saved if the model is saved as a Part 21 file; likewise, the header entities will have a default value if the model was not read in from a Part 21 file.

The description entity returned by this function is defined by the following EXPRESS:

    ENTITY file_description;
             description           : LIST [1:?] OF STRING (256);
             implementation_level  : STRING (256);
    END_ENTITY;

Example

    SdaiAggr desc_list;
    SdaiInstance desc;

    desc = _sdaiHeaderDescription (model); 
    sdaiGetAttrBN (name, "description", sdaiAGGR, &desc_list);
    sdaiInsertByIndex (auth, 0, sdaiSTRING, "A Sample STEP File"); 

See Also

RoseDesign::header_description() in the Rose Library Reference Manual.

_sdaiGetHeaderName()

int _sdaiGetHeaderName(
	SdaiModel mod
	);

The _sdaiGetHeaderName() function returns name instance from the STEP Part 21 file corresponding to the model. This instance may be queried to set the fields in the Part 21 file header, or its attributes may be changed to set the fields in the file header when the file is written out. Changes made to the header entities will only be saved if the model is saved as a Part 21 file; likewise, the header entities will have a default value if the model was not read in from a Part 21 file.

The name entity returned by this function is defined by the following EXPRESS:

    ENTITY file_name;
         name          : STRING (256);
         time_stamp    : STRING (256);
         author        : LIST [1:?] OF STRING (256);
         organization  : LIST [1:?] OF STRING (256);
         preprocessor_version   : STRING (256);
         originating_system     : STRING (256);
         authorization          : STRING (256);
    END_ENTITY;

Example

    SdaiAggr auth;     
    SdaiInstance name;

    name = _sdaiHeaderName (model); 
    sdaiGetAttrBN (name, "author", sdaiAGGR, &auth);
    sdaiInsertByIndex (auth, 0, sdaiSTRING, "Fred Foo"); 

See Also

RoseDesign::header_name() in the Rose Library Reference Manual.

_sdaiGetInstanceSectionModel()

SdaiModel _sdaiGetInstanceSectionModel(
	SdaiInstance inst
	);

The _sdaiGetIntanceSectionModel() function returns the model for the design section containing the specified instance. When dealing with models that have multiple data sections, this function allows you to access a specific section, and determine which section an instance belongs to.

See Also

_sdaiGetModel(). Low-Level Model API

_sdaiGetInverseAttrDefinitions()

SdaiNPL _sdaiGetInverseAttrDefinitions (
	SdaiEntity entity,
	SdaiNPL list
	);

The _sdaiGetInverseAttrDefinitions() function determines the inverse attributes of an entity and places them into a user specified non-persistent list. This information can be determined be examining the dictionary, but this function provides a more efficient and convenient way to determine this information.

_sdaiGetModel()

SdaiModel _sdaiGetModel (
	RoseDesign * des
	);
SdaiModel _sdaiGetModel (
	RoseDesignSection * des
	);
	 

The _sdaiGetRoseDesign() function returns the SDAI model associated with a RoseDesign or RoseDesignSection. This function is only available to C++ applications, and <rose.h> must be included before <sdai.h>.

The version of _sdaiGetRoseDesign() that takes a RoseDesignSection, always returns a model associated with a design section. The version that takes a RoseDesign, tries to find an existing, fully functional, sdai_model for the design. If such a model has not been opened, it creates a light-weight model for the design.

Errors

     sdaiMO_NEXS - model does not exist

See Also

_sdaiGetRoseDesign(); Low-Level Model API

_sdaiGetProp()

void* _sdaiGetProp (
	_SdaiPropType type,
	SdaiAppInstance inst
	);

The _sdaiGetProp() function returns the value of a property attached to an instance. This function returns the property as a void * -- a generic pointer to any type of data. You are responsible for casting the value to the appropriate type.

Errors

    sdaiSS_NOPN    	session not open     
    sdaiEI_NEXS    	NULL entity/entity not an application instance

Example

See _sdaiSetProp()

See Also

_sdaiGetPropType(); _sdaiSetProp(); _sdaiRemoveProp()

_sdaiGetPropType()

_SdaiPropType _sdaiGetPropType ();

The _sdaiGetPropType() extension function allocates a new property type identifier. This function must be called to obtain a property identifier which can be used as a parameter to the other property function.

The return value of this function should be cached in a global variable, or other location where the value will be available for as long as the property may be used. If this function is called a second time, a second unique property identifier is generated.

Example

See _sdaiSetProp()

See Also

_sdaiGetPropType(); _sdaiSetProp(); _sdaiRemoveProp()

_sdaiGetRoseAggregate()

RoseAggregate* _sdaiGetRoseAggregate (
	SdaiAggr inst
	);

The _sdaiGetRoseAggregate() function returns the ROSE aggregate which corresponds to an SDAI aggregate. If the aggregate does not have a corresponding ROSE objects (e.g session objects), this function returns NULL.

_sdaiGetRoseDesign()

RoseDesign * _sdaiGetRoseDesign (
	SdaiModel mod
	);

The _sdaiGetRoseDesign() function returns the RoseDesign associated with an SDAI model. This function is only available to C++ applications, and <rose.h> must be included before <sdai.h>.

Errors

    sdaiSS_NOPN    	session not open   
    sdaiMO_NEXS    	NULL or invalid model
    sdaiMX_NDEF    	model not accessable 

See Also

_sdaiGetModel()

_sdaiGetRoseStructure()

RoseStructure* _sdaiGetRoseStructure (
	SdaiAppInstance inst
	);

The _sdaiGetRoseStructure() function returns the ROSE object which corresponds to an entity instance. If the instance does not have a corresponding ROSE objects (e.g session objects), this function returns NULL.

_sdaiGetSchemaList()

void _sdaiGetSchemaList (
	SdaiModel mod,
	SdaiNPL list
	);

The _sdaiGetSchemaList function returns the schema list for a model. This is a non-standard extension to the SDAI which allows you to manipulate data files what have multiple schemas. This function takes an existing NPL (the list parameter), and populates it with instances of SdaiSchema, one for every schema the model has.

_sdaiGetSubtypes()

SdaiNPL _sdaiGetSubtypes (
	SdaiEntity entity,
	SdaiNPL list
	);

The _sdaiGetSubypes() function determines the complete set of subtypes of an entity, and places them into a user specified non-persistent list. This information can be determined be examining the dictionary, but this function provides a more efficient and convenient way to determine this information.

_sdaiGetSupertypes()

SdaiNPL _sdaiGetSupertypes (
	SdaiEntity entity,
	SdaiNPL list
	);

The _sdaiGetSupertypes() function determines the complete list of supertypes of an entity, and places them into a user specified non-persistent list. This information can be determined be examining the dictionary, but this function provides a more efficient and convenient way to determine this information.

_sdaiGetUniquenessDefinitions()

SdaiNPL _sdaiGetUniquenessDefinitions (
	SdaiEntity entity,
	SdaiNPL list
	);

The _sdaiGetUniquenssDefinitions() function determines the uniqueness rules of an entity and places them into a user specified non-persistent list. This information can be determined be examining the dictionary, but this function provides a more efficient and convenient way to determine this information.

_sdaiRemoveProp()

void _sdaiRemoveProp (
	_SdaiPropType type,
	SdaiAppInstance inst
	);

The _sdaiRemoveProp() function removes a property from an instance.

Errors

    sdaiSS_NOPN    	session not open   
    sdaiEI_NEXS    	NULL entity/entity not an application instance

See Also

_sdaiGetPropType(); _sdaiSetProp(); _sdaiGetProp()

_sdaiRescanRepository()

void _sdaiRescanRepository (
	SdaiRep repository
	);

The _sdaiRescanRepository() function causes the SDAI library to recalculate the set of models in a repository. This may be necessary if another application creates a new model after the current process has already opened a repository, and the SDAI application wishes to access the newly created model.

Errors

    sdaiRP_NEXS    	NULL or invalid repo 
    sdaiRP_NOPN    	repository is not open 
    sdaiSS_NOPN    	session not open

Example

    _sdaiRescanRepository(repo);

_sdaiSaveAs()

void _sdaiSaveAs (
	SdaiModel model,
	SdaiString asname
	);

The _sdaiSaveAs() function saves a model under a specified name.

_sdaiSetModelFormat()

void _sdaiSetModelFormat(
	SdaiModel mod, 
	SdaiString format
	);

The _sdaiSetModelFormat() extension function sets the file format for a model. This function merely exposes the RoseDesign::format() method to SDAI applications.

The format parameter identifies the file format to use. Legal values include "rose", for text rose files; "standard" for compact binary files; and "step" for STEP Part 21 exchange files. The default format is the same as the model was read in from. New models default to "standard".

Errors

    sdaiSS_NOPN    	session not open 
    sdaiMO_NEXS    	NULL or invalid model
    sdaiMX_NDEF    	model not accessable 

Example

    _sdaisetModelFormat (mod, "step");

See Also

RoseDesign::format() in the Rose Library Reference Manual.

_sdaiSetProp()

void _sdaiSetProp (
	_SdaiPropType type,
	SdaiAppInstance inst,
	void * value
	);

The _sdaiSetProp() function sets the value of a property.

A property is a piece of user data attached to an SDAI instance. This feature allows you to avoid creating hash table or other data structures to associate additional data with an instance. An instance may have multiple properties associated with it, however each property must have a unique type. Properties are not stored when the model is saved. They may by used to keep back pointers, or other data associated with the value.

The property is defined as a void * -- a pointer to any type of data. You are responsible for casting the value to the correct C type before accessing the value.

Errors

    sdaiSS_NOPN    	session not open 
    sdaiEI_NEXS    	NULL entity/entity not an application instance

Example

    SdaiAppInstance inst1, inst2;
    _SdaiPropType name_prop = _sdaiGetPropType();

    /* Find the instances for inst1 and inst2 */    	

    /* Store the properties */ 
    _sdaiSetProp (name_prop, inst1, "testobj1");
    _sdaiSetProp (name_prop, inst2, "testobj2");

    /* Print the properties out */
    printf ("Name=%s\n", (char*)_sdaiGetProp(name_prop, inst1));
    printf ("Name=%s\n", (char*)_sdaiGetProp(name_prop, inst2));

See Also

_sdaiGetPropType(); _sdaiGetProp(); _sdaiRemoveProp()

_sdaiVerbose()

void _sdaiVerbose(
	SdaiBoolean print_messages 
	);

The _sdaiVerbose function is used to control ROSE error reporting. By default, the SDAI is in verbose mode. To make the binding more quiet, call _sdaiVerbose() with the parameter sdaiFALSE before any other call.

This function only effects ROSE error reporting. To control SDAI error reporting, use sdaiSetErrorHandler().

See Also

sdaiSetErrorHandler()