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 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.
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: edmiReadStepFile , edmiWriteStepFile , edmiGetStepIdOfInstance , edmiGetInstanceOfStepId .
Header:
#include "sdai.h"
Prototype:
EdmiError edmiImportStepFile(SdaiString fileName,
SdaiString logFileName,
SdaiString repositoryName,
SdaiString modelName,
SdaiString schemaName,
SdaiString shortNamesFile,
SdaiInteger options,
SdaiModel *modelId,
SdaiErrorCode *sdaiError);
Arguments:
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 |
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. |
repositoryName |
Specifies the name of the data repository that hosts the data model that receives the imported data set (STEP file). Repository names are case sensitive. |
modelName |
Specifies the name of the data model to populate with the data found on the read STEP file. Normally this data model is created during the edmiImportStepFile operation, but an existing data model can be specified as well. |
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 (See EXPRESS: above). 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 edmiImportStepFile function is invoked. |
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 and can be downloaded from http://www.steptools.com/short_names/index.html. |
options |
Specifies the current import options. The options value should be specified as a bitwise OR, See descriptions below for more details. The options that are applicable for the edmiImportStepFile function are applicable for this function as well. |
modelId |
Address of a variable that will receive the modelID that uniquely identifies the data model in the EDMdatabase populated by this operation |
sdaiError |
Address of a variable that will receive the EDMinterface error code when the edmiImportStepFile 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. |
Options:
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 : The EDMinterface is initialized.
Completion code != 0: The EDMinterface is not initialized. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
SdaiModel modelId;
EdmiError rstat;
SdaiErrorCode sdaiError;
SdaiInteger nFatals, nRecoveries, nWarnings, nInfo, total, nLines;
. . .
if (rstat = edmiImportStepFile(
"\hkd\stp\bumper.stp", /* STEP file name */
"splog.log", /* Log file name */
"DataRepository", /* Repository */
"Bumper", /* New model name */
NULL, /* Default : use schema in STEP Header section */
NULL, /* No shortNamesFile */
LOG_ERRORS_AND_WARNINGS_ONLY | LOG_TO_FILE, /* options */
&modelId, /* Returned modelID of populated data model */
&sdaiError)) {
/* Error in operation */
printf("\nError: %s in edmiImportStepFile\n",
edmiGetErrorText(rstat));
goto error;
}
if (sdaiError) {
printf ("\nEDMinterface error in edmiImportStepFile: %s",
edmiGetErrorText(sdaiError));
}
edmiGetStepReadResults(&nFatals,
&nRecoveries,
&nWarnings,
&nInfo,
&total,
&nLines);
printf("\n\nResult of edmiImportStepFile 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);
. . .
edmiInsertTableInstanceRows
Description:
This function will adds a given number rows in a EDMtableInstance.
Related functions:
edmiCreateTableInstance, edmiDeleteTableInstance, edmiGetTableInstanceId, edmiIsTableInstance, edmiGetTableInstancesEntityExtent, edmiCreateTableInstanceColumn,
edmiDeleteTableInstanceColumn, edmiSetTableInstanceColumnsValue, edmiGetTableInstanceColumnsValue, edmiGetTableInstanceColumnNumber,
edmiDeleteTableInstanceRows, edmiGetTableInstanceProperties, edmiSetTableInstanceProperty, edmiGetTableInstanceProperty
Header:
#include "sdai.h"
Prototype:
EdmiError edmiInsertTableInstanceRows (SdaiInstance tableInstanceId,
SdaiInteger rowNumber,
SdaiInteger rows,
SdaiInteger *newRowNumber);
Arguments:
Argument typeArgument nameComments
SdaiInstance tableInstanceId
SdaiInteger rowNumberPosition of new rows, First row Number is 1 (not zero)
SdaiInteger rowsNumber of empty rows to insert
SdaiInteger *newRowNumberRow number of first inserted row
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