edmiImportStepFile

EdmiError edmiImportStepFile(SdaiString    fileName,
                              SdaiString    logFileName, 
                              SdaiString    repositoryName, 
                              SdaiString    modelName, 
                              SdaiString    schemaName, 
                              SdaiString    shortNamesFile, 
                              SdaiInteger   options, 
                              SdaiModel     *modelId, 
                              SdaiErrorCode *sdaiError); 

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. 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.

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;

Arguments


1TypeNameComment
2SdaiString

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

3SdaiString

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. This argument is only effective when the [LOG_TO_FILE] option is set.

4SdaiString

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.

5SdaiString

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.  Model names must be 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.

6SdaiString

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.  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.

7SdaiString

shortNamesFile

Specifies the name of the file containing the mapping matrix between full entity names and its unique short name.

8SdaiInteger

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.

9SdaiModel

modelId

Address of a variable that will receive the modelID that uniquely identifies the data model in the EDMdatabase populated by this operation

10SdaiErrorCode

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.

Return Value


Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_r_EDMInterface'.

Options


 

 OptionComment
1

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.

2

COMPRESSED_FILE  

Same as ZIPPED_FILE

3

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.

4

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.

5

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.

6

DELETING_EXISTING_MODEL

When the specified <modelName> exists, it well be deleted and recreated at the invocation of the edmiReadStepFile operation.

7

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.

8

DELETE_INSTANCES_WITH_REFS

 

9

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.

10

HEADER_MODEL_ONLY

 

11

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.         

12

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.

13

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
are legal to be able in  the same stepRead operation.

14

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
are legal to be able in  the same stepRead operation.

15

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

16

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.

17

LOG_ERRORS_AND_WARNINGS_ONLY

Limits the log to only include logging of instances related to errors and warnings.

18

LOG_TO_FILE

Logged information will be stored in a file specified by the <Log file> argument.

19

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.

20

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.

21

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.

22

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.

23

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:

  1. The built in function USEDIN,
  2. The EDMinterface operations: edmiUsedIn, edmiUsedInBN, and edmiGetInstanceReferences
  3. The ExpressX function xpxGetInstanceReferences
    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.
24

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.

25

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.
    

26

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.

27

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.

28

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.

29

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.

30

UNPACKED_MODEL

 

31

USER_CONTROLLED_INVERSE

 

32

UTF8_ENCODED_FILE_NAMES

 

33

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.

34

ZIPPED_FILE

The actual "stepFile" is a "zipped" file.

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);
 . . .

 

See also

Filter by label

There are no items with the selected labels at this time.

 Â