edmiWriteXMLDocument
EdmiError edmiWriteXMLDocument(SdaiModel modelId,
SdaiInstance *instanceBuffer,
SdaiInteger startIndex,
SdaiInteger maxNumberOfInstances,
SdaiInteger *actualNumberOfInstances,
SdaiSelect pSel,
SdaiModel headerModelId,
SdaiInstance xmlConfigurationId,
SdaiString encodingEdm,
SdaiString encodingOut,
SdaiUnsignedInt options,
SdaiXml pXml);
<Description>
Arguments
| 1 | Type | Name | Comment |
| 2 | SdaiModel | modelId | The instanceId that uniquely identifies the model to export in the EDMdatabase. |
| 3 | SdaiInstance | *instanceBuffer | A NULL terminated list of instances to export to file in XML format. If set to NULL, the entire model will be exported. |
| 4 | SdaiInteger | startIndex | The index of the first element in <instanceBuffer> to export to the XML file. |
| 5 | SdaiInteger | maxNumberOfInstances | The maximum number of instances to export from the <instanceBuffer>. |
| 6 | SdaiInteger | *actualNumberOfInstances | Receives the actual number of instances exported to the XML file from the <instanceBuffer>. |
| 7 | SdaiSelect | pSel | An SdaiSelect structure specifying the data export to XML file. This parameter represents an alternative to the <instanceBuffer> way of specifying export data. |
| 8 | SdaiModel | headerModelId | Header modelId containing values for the iso_10303_28_header element. |
| 9 | SdaiInstance | xmlConfigurationId | Instance Id of the preferred configuration for the XML. If NULL, the system looks for a configuration with name "default" in the schema. If "default" configuration is not found EDM supplies the following one: |
| 10 | SdaiString | encodingEdm | The encoding of data in EDM (source). Default is UTF8. Legal values are;
|
| 11 | SdaiString | encodingOut | The desired character encoding for the destination. Default is UTF8 |
| 12 | SdaiUnsignedInt | options | Specifies the options that are enabled in the invocation of the edmiWriteXMLDocument function. The <options> value should be specified as a bitwise OR between the options to enable. All option names are defined in the header file sdai.h . |
| 13 | SdaiXml | pXml | Document exchange struct with the incoming XML. See sdai.h for detailed description of all data structure elements. |
Return Value
Options
Option | Comment |
|---|---|
INCLUDE_HEADER | Include header element when writing ISO_10303_28 document |
INCLUDE_CONFIGURATION | Include configuration element when writing ISO_10303_28 document |
INCLUDE_SCHEMA | Include schema elements when writing ISO_10303_28 document |
EXTRACT_SHALLOW | Use this option to prevent referenced instances to be exported. By default EDM will export all the instances given in <psel> or <instanceBuffer> and the entire mesh of referenced instances that spreads out from them. |
EDM_IDENTIFIERS | Use the full internal instanceIds of EDM as step Ids in the exported XML file. By default, the step Ids are the local references from within each model. |
Example
EdmiError rstat;
EdmiError rstat;
SdaiModel modId, modHeaderId, dictModId;
SdaiInteger nHits = 1, index = 1;
SdaiInstance xmlConfigId, instId;
SdaiSchema schemaId;
SdaiAggr aggrId;
tSdaiSelect sel = { 0, sdaiAGGR, NULL, 0 };
tEdmXml xml = { "c:/London/Block34.xml", NULL, 0,
NULL, NULL, 0, 0, NULL, NULL, 0, NULL};
modId = edmiGetModelBN("London", "Block34");
modHeaderId = edmiGetModelBN("London", "BlockHeader");
sdaiGetAttrBN(modId, "UNDERLYING_SCHEMA", sdaiINSTANCE, &schemaId);
dictModId = sdaiGetInstanceModel(schemaId);
rstat = edmiGetXMLConfigurationId(dictModId, "XMLBlock", &xmlConfigId);
rstat = edmiFindInstancesBN(modId, "BUILDING", "id=32FC", 1,
&index, &nHits, &instId);
sdaiGetAttrBN(instId, "FLOORS", sdaiAGGR, &aggrId);
sel.value.aggrVal = aggrId;
if (rstat = edmiWriteXMLDocument(modId, NULL, 0, 1000, &nHits,
&sel, modHeaderId, xmlConfigId,
"UTF-8", "UTF-8",
INCLUDE_HEADER | INCLUDE_SCHEMA,
&xml)) {
printf("\nError %d in edmiWriteXMLDocument: %s", rstat,
edmiGetErrorText(rstat));
goto Error;
}
. . .
See also
Filter by label
There are no items with the selected labels at this time.