edmiReadStepFile
EdmiError edmiReadStepFile(SdaiString fileName, SdaiString logFileName, SdaiString sumFileName, SdaiString repositoryName, SdaiString headerModelName, SdaiString modelName, SdaiString schemaName, SdaiString shortNamesFile, SdaiInteger cacheSize, SdaiInteger options, SdaiErrorCode *sdaiError);
Reads a STEP Physical File into EDMdatabase. Normally the imported data set will be stored in a new data model. Optionally the read data set can be added to an existing data model. The Express schema that defines the structure in the Data Section of the actual STEP file must exist as a dictionary model in EDMdatabase before this function can be successfully executed. The name of this Express schema is found in the attribute FILE_SCHEMA.SCHEMA_IDENTIFIERS in the Header Section of the STEP file. The STEP Physical File format is defined in to ISO 10303-21: Clear text encoding of the exchange structures. A STEP Physical File is also referred to as a Part 21 file. This is one of the implementation forms of ISO 10303, and can be used to exchange data between two EDMdatabases or between the EDMdatabase and any application that conforms to ISO 10303-21. The STEP Physical File format is also suitable for long time archiving of data. When the option KEEP_STEP_IDENTIFIERS is enabled, a STEP Identifier model is created and connected to the data model created by this operation. The purpose of this STEP Identifiers model is to hold the correspondence between the entity instance identifiers on the actual STEP file (stepID) and the related instanceID in the EDMdatabase. No STEP Identifiers model can be created when the ADD_TO_EXISTING_MODEL option is enabled.
The STEP Identifiers model will be opened for read only access when the related data model is opened, and the STEP Identifiers model will be deleted when the connecting data model is deleted. The STEP Identifiers model can also be handled as an individual model with respect to the EDMdatabase operations. A STEP Physical File can be created by the edmiWriteStepFile function. The edmiImportStepFile operation is very similar to the edmiReadStepFile operation except that arguments that is no longer valid for the read STEP file operation are omitted and some optional arguments are given a default value in the edmiImportStepFile operation.
SCHEMA header_section_schema; TYPE SCHEMA_NAME = STRING (256); END_TYPE; ENTITY file_description; description : LIST OF STRING (256); implementation_level : STRING (256); END_ENTITY; ENTITY file_name; name : STRING (256); time_stamp : STRING (256); author : LIST OF STRING (256); organization : LIST OF STRING (256); preprocessor_version : STRING (256); originating_system : STRING (256); authorisation : STRING (256); END_ENTITY; ENTITY file_schema; schema_identifiers : LIST OF SCHEMA_NAME; END_ENTITY; END_SCHEMA;
Arguments
1 | Type | Name | Comment |
2 | SdaiString | fileName | Specifies the name of the file that contains the STEP Physical File to be read by this operation. The default file extension is .stp |
3 | SdaiString | logFileName | Specifies the name of a file that will contain a log of the imported STEP file. The log will be a copy of the specified STEP file with a line sequence number added at the start of each line. In addition all warnings and errors detected during the read operation will be written to the place in the log file where the warning and/or error condition occurred. An empty argument, i.e. <logFileName> = NULL means that no log file is produced. |
4 | SdaiString | sumFileName | Dummy argument, i.e., has no effect. This argument is included for compatibility with previous versions of the EXPRESS Data Manager™. |
5 | SdaiString | repositoryName | Specifies the name of the data repository that will hold the new created model, or that holds the existing model when one of the options KEEP_EXISTING_MODEL or DELETRE_EXISTING_MODEL are specified. Repository names are case sensitive. |
6 | SdaiString | headerModelName | Specifies the name of the STEP Header model to be created and populated. The model must have a name that is unique within the repository that holds the model. The model name must start with a letter and the rest of the model name can be any mix of alphanumeric characters and the underscore character. Model names are case sensitive. The default name convention used for STEP Header models in EXPRESS Data Manger is: the name of the data model to create with the appendix "_HeaderModel". This convention makes it easy to find the STEP Header model corresponding to a particular data model and vice versa. When this argument is empty, i.e. <headerModelName> = NULL means that no STEP Header model will be created. |
7 | SdaiString | modelName | Specifies the name of the data model to be created and populated with the data found on the read STEP file. The model must have a name that is unique within the repository that holds the model. The model name must start with a letter and the rest of the model name can be any mix of alpha numeric characters and the underscore character. Model names are case sensitive. <modelName> can be an existing data model when one of the options KEEP_EXISTING_MODEL or DELETRE_EXISTING_MODEL are specified |
8 | SdaiString | schemaName | The name of the Express schema that defines the structure of the data in the Data Section of the actual STEP file is found in the attribute FILE_SCHEMA.SCEMA_IDENTIFIERS in the Header Section of the STEP file. This schema will be used as the underlying schema of the new data model resulting from this command, hence this Express schema must exist as a dictionary model in the EDMdatabase when the edmReadStepFile function is invoked. If for one reason or another this schema exists with another name in the actual EDMdatabase, this argument can be used to overrule the schema name found in the Header Section of the STEP file, else this argument should be blank. To overrule the Express schema name found in the Header Section of the STEP file, specify the name of an Express schema that will be used as the underlying schema of the new data model resulting from this function. The name of an Express schema is case insensitive. The specified Express schema must exist as a dictionary model in EDMdatabase. |
9 | SdaiString | shortNamesFile | Specifies the name of the file containing the mapping matrix between full entity names and its unique short name. For each STEP AP, a short name file is provided by ISO TC184/SC4 |
10 | SdaiInteger | cacheSize | Argument no more valid. Argument just kept for compatibility reasons. |
11 | SdaiModel | options | Specifies the options that will be used in the execution of the edmiReadStepFile function. The options value should be specified as a bitwise OR between the options to be enabled. All available options are defined in the header file sdai.h . An option value equals zero gives the default options. See below for a detailed description of the available options. |
12 | SdaiErrorCode | sdaiError | Address of a variable that will receive the EDMinterface error code when the edmiReadStepFile function receives an error code in the communication with the EDMserver. The function edmiGetErrorText can be used to get the error message that corresponds to the EDMinterface error code. |
Return Value
Options
Option | Comment |
---|---|
ADD_TO_EXISTING_MODEL | The imported data set (STEP file) will be added to the existing data model <modelName>. The <modelName> data model must be a model with the required underlying schema ,i.e., the schema specified in the header section of the STEP file or the schema specified in the <schemaName> argument. This option enables incremental population of a data model from STEP files. |
COMPRESSED_FILE | Same as ZIPPED_FILE |
CONFORMANCE_CLASS_1 | Overrules the mapping method given in the Header Section of the actual STEP file such that the STEP file will be interpret according to ISO 10303-21:1994/TC1 CC1. The options [CONFORMANCE_CLASS_1], [CONFORMANCE_CLASS_2], and [DIS_VERSION] are mutually exclusive, i.e., only one of these options should be activated in one execution of the edmiReadStepFile function. |
CONFORMANCE_CLASS_2 | Overrules the mapping method given in the Header Section of the actual STEP file such that the STEP file will be interpret according to ISO 10303-21:1994/TC1 CC2. The options [CONFORMANCE_CLASS_1], [CONFORMANCE_CLASS_2], and [DIS_VERSION] are mutually exclusive, i.e., only one of these options should be activated in one execution of the edmiReadStepFile function. |
DIS_VERSION | Overrules the mapping method given in the Header Section of the actual STEP file such that the STEP file will be interpret according to ISO 10303-21:1994/TC1 DIS version. The options [CONFORMANCE_CLASS_1], [CONFORMANCE_CLASS_2], and [DIS_VERSION] are mutually exclusive, i.e., only one of these options should be activated in one execution of the edmiReadStepFile function. |
DELETING_EXISTING_MODEL | When the specified <modelName> exists, it well be deleted and recreated at the invocation of the edmiReadStepFile operation. |
DELETE_INSTANCE_REFS_ON_DELETE | The sdaiDeleteInstance operation will be legal for instances with references. The references to the actual instances will automatically be deleted when the actual instance is deleted by the sdaiDeleteInstance operation. This option can improve the performance of data manipulation in this model. Normally this option should only be used on "temporarily models", i.e., models that is imported into another system than the persistent EDMdatabase. |
DELETE_INSTANCES_WITH_REFS |
|
EXCLUDE_USER_DEFINED_ENTITIES | All instances of UserDefinedEntities in the actual "stepFile" will be skipped, i.e., these instances will not be populated in the resulting EDMdataModel by the STEPread operation. |
HEADER_MODEL_ONLY |
|
INSTANCES_IN_CONTAINER | All instances created by the actual STEPread operation will be inserted in an EDMcontainer that will be created by the STEPread operation. The actual EDMcontainerId is returned in the "containerId" argument in the actual readStep operation invocation. Only one of the options INSTANCES_IN_MODEL_LOCK_CONTAINER, INSTANCES_IN_MODEL_CONTAINER, INSTANCES_IN_LOCK_CONTAINER, INSTANCES_IN_CONTAINER are legal to be able in the same stepRead operation. |
INSTANCES_IN_LOCK_CONTAINER | All instances created by the actual STEPread operation will be inserted in an EDMlockContainer that will be created by the STEPread operation. The actual EDMlockContainerId is returned in the "containerId" argument in the actual STEPread operation invocation. Only one of the options INSTANCES_IN_MODEL_LOCK_CONTAINER, INSTANCES_IN_MODEL_CONTAINER, INSTANCES_IN_LOCK_CONTAINER, INSTANCES_IN_CONTAINER are legal to be able in the same stepRead operation. |
INSTANCES_IN_MODEL_LOCK_CONTAINER | All instances created by the actual STEPread operation will be inserted in an EDMmodelLockContainer that will be created by the STEPread operation. The actual EDMmodelLockContainerId is returned in the "containerId" argument in the actual readStep operation invocation. Only one of the options INSTANCES_IN_MODEL_LOCK_CONTAINER, INSTANCES_IN_MODEL_CONTAINER, INSTANCES_IN_LOCK_CONTAINER, INSTANCES_IN_CONTAINER |
INSTANCES_IN_MODEL_CONTAINER | All instances created by the actual STEPread operation will be inserted in an EDMmodelContainer that will be created by the STEPread operation. The actual EDMmodelContainerId is returned in the "containerId" argument in the actual readStep operation invocation. Only one of the options INSTANCES_IN_MODEL_LOCK_CONTAINER, INSTANCES_IN_MODEL_CONTAINER, INSTANCES_IN_LOCK_CONTAINER, INSTANCES_IN_CONTAINER |
ISO_LATIN_1_STRING_ENCODING | The STRING data types in the resulting new EDMdataModel will be encoded in ISO-LATIN-1 style string encoding. Only one of the options UTF_8_STRING_ENCODING and ISO_LATIN_1_STRING_ENCODING are legal in the same STEPread operation. The ISO-LATIN-1 style string encoding is the default string encoding style in the resulting EDMdataModel, i.e., when neither UTF_8_STRING_ENCODING nor ISO_LATIN_1_STRING_ENCODING is specified. This option has no effect when the option ADD_TO_EXISTING_MODEL is used |
ISO_8859_1_STRING_ENCODING | The STRING data types in the resulting new EDMdataModel will be encoded in ISO-LATIN-1 style string encoding. Only one of the options UTF_8_STRING_ENCODING and ISO_LATIN_1_STRING_ENCODING are legal in the same STEPread operation. The ISO-LATIN-1 style string encoding is the default string encoding style in the resulting EDMdataModel, i.e., when neither UTF_8_STRING_ENCODING nor ISO_LATIN_1_STRING_ENCODING is specified. This option has no effect when the option ADD_TO_EXISTING_MODEL is used. |
LOG_ERRORS_AND_WARNINGS_ONLY | Limits the log to only include logging of instances related to errors and warnings. |
LOG_TO_FILE | Logged information will be stored in a file specified by the <Log file> argument. |
LOG_TO_STDOUT | Logged information will be written to the EDMinterface current output device. The EDMinterface current output device can be defined by the edmiDefineOutputFunction operation. |
KEEP_STEP_IDENTIFIERS | A STEP Identifier model will be created and connected to the data model created by this operation. The STEP Identifier model will keep the correspondence between the STEP file entity instances (stepID) and the EDMdatabase instanceID that uniquely identifies the same instance. |
NO_STRING_ENCODING | Specifies that the actual STEP file has no encoding of SdaiString data values, hence no decoding will take place during the read operation. The ISO 10303-21 specifies that all characters in a STRING data type that have an ASCII value less than 32 or greater than 126 should be encoded in a STEP file and hence decoded when reading the STEP file into an EDMdatabase. |
NOT_CLOSE_MODEL | The data model will not be closed by the edmiReadStepFile operation, i.e., the calling application can start using the imported model immediately without opening the model. This option can improve the performance of data manipulation in this model. Normally this option should only be used on "temporarily models", i.e., models that is imported into another system than the persistent EDMdatabase. |
NO_INSTANCE_REFERENCES | No "instance references tables" will be created and maintained in the actual model. The following operations will not work on the actual data model when this option is enabled:
|
ONE_FILE_STEP_FILE_PACKAGE | The actual "stepFile" to read is an EDMstepFilePackage consisting of one single file.An EDMstepFilePackage is an EDM proprietary extension of the iSO 10303-21 to enable the mapping of the EDM proprietary data types EDMfile and EDMblob to an P21 file. An EDMstepFilePackage can consist of one single file or a collection of files. |
ONLY_USER_DEFINED_ENTITIES | Only instances of UserDefinedEntities in the actual "stepFile" will be populated in the actual EDMdataModel by the STEPread operation. All other instance types on the actual "stepFile" will be skipped. |
OPEN_MODEL_FOR_LOCAL_READ_WRITE | This option opens the actual resulting EDMdataModel for LocalReadWrite mode, i.e., this model will not be updated on the EDMdatabase controlled by the actual running EDMserver. The purpose of this option is to implement a method for "local temporary models" in an EDMserver system. This options has only effect in an EDMserver system. |
PARSE_ONLY | The specified STEP file will be parsed only, i.e. only checked for syntactical correctness, no data will be stored in the EDMdatabase. |
PRE_PARSE_FILE | Specifies that the actual import process will be performed in two passes, i.e., the actual STEP file will be read twice. This option may increase performance for STEP files with many forward references. |
STEP_FILE_PACKAGE | The "stepFile" to read in the actual STEPread operation is an EDMstepFilePackage. An EDMstepFilePackage is an EDM proprietary extension of the iSO 10303-21 to enable the mapping of the EDM proprietary data types EDMfile and EDMblob to an P21 file. |
UNPACKED_MODEL |
|
USER_CONTROLLED_INVERSE |
|
UTF8_ENCODED_FILE_NAMES |
|
UTF_8_STRING_ENCODING | The STRING data types in the resulting new EDMdataModel will be encoded in UTF-8 style string encoding. Only one of the options UTF_8_STRING_ENCODING and ISO_LATIN_1_STRING_ENCODING are legal in the same STEPread operation. This option has no effect when the option ADD_TO_EXISTING_MODEL is used. |
ZIPPED_FILE | The actual "stepFile" is a "zipped" file. |
Example
EdmiError rstat; SdaiErrorCode sdaiError; SdaiInteger nFatals, nRecoveries, nWarnings, nInfo, total, nLines; . . . if (rstat = edmiReadStepFile ( "\hkd\stp\bumper.stp", /* STEP file name */ "splog.log", /* Log file name */ NULL, /* Sum file */ "DataRepository", /* Repository */ NULL, /* No STEP Header model */ "Bumper", /* New model name */ NULL, /* Default : use schema in STEP Header section */ NULL, /* No shortNamesFile */ 0, /* Dummy */ LOG_ERRORS_AND_WARNINGS_ONLY | LOG_TO_FILE, /* options */ &sdaiError)) { /* Error in operation */ printf("\nError: %s in edmiReadStepFile\n", edmiGetErrorText(rstat)); goto error; } if (sdaiError) { printf ("\nEDMinterface error in edmiReadStepFile: %s", edmiGetErrorText(sdaiError)); } edmiGetStepReadResults(&nFatals, &nRecoveries, &nWarnings, &nInfo, &total, &nLines); printf("\n\nResult of edmiReadStepFile operation: "); printf("\nFatal errors...........: %ld", nFatals); printf("\nRecoverable errors.....: %ld", nRecoveries); printf("\nWarnings...............: %ld", nWarnings); printf("\nInfo...................: %ld", nInfo); printf("\ntotal..................: %ld", total); printf("\nLines..................: %ld\n", nLines); . . .
See also
Filter by label
There are no items with the selected labels at this time.