...
Imports Imports a STEP Physical File into EDMdatabase. Normally the imported data set will be stored in a new data model. Optionally the imported 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. See EXPRESS below.
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 EDMdatabase s 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 edmiReadStepFile operation is very similar to the edmiImportStepFile operation except that edmiReadStepFile operation have a few more arguments such that more details can be specified.
For information on the format of the file in argument <shortNamesFile>, see Short names in the EDMsupervisor User Guide.
EXPRESS:
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;
Related functions: edmiImportStepFile , edmiWriteStepFile , edmiGetStepIdOfInstance , edmiGetInstanceOfStepId .
Header:
#include "sdai.h"
Prototype:
EdmiError edmiReadStepFile(SdaiString fileName,
SdaiString logFileName,
SdaiString sumFileName,
SdaiString repositoryName,
SdaiString headerModelName,
SdaiString modelName,
SdaiString schemaName,
SdaiString shortNamesFile,
SdaiInteger cacheSize,
SdaiInteger options,
SdaiErrorCode *sdaiError);
Arguments:
...
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. |
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. |
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. |
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. |
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. |
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 |
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 |
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 |
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_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 |
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. |
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. |
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. |
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 |
ONLY_USER_DEFINED_ENTITIES | Only instances of UserDefinedEntities in the actual "stepFile" will be populated in the actual EDMdataModel by the STEPread operation. |
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 |
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. |
STEP_FILE_PACKAGE | The "stepFile" to read in the actual STEPread operation is an EDMstepFilePackage. |
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. |
ZIPPED_FILE | The actual "stepFile" is a "zipped" file. |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
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);
. . .