Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

Commit 534f7b7

Browse files
committed
MINOR: add merge and optimize routes
1 parent fd9cfaf commit 534f7b7

17 files changed

Lines changed: 348 additions & 28 deletions

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,14 +363,15 @@ Class | Method | HTTP request | Description
363363
*bimdata.IfcApi* | [**getZoneSpaces**](docs/IfcApi.md#getZoneSpaces) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/zone/{zone_pk}/space | Retrieve all spaces of a zone
364364
*bimdata.IfcApi* | [**getZones**](docs/IfcApi.md#getZones) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/zone | Retrieve zones of a model
365365
*bimdata.IfcApi* | [**listClassificationElementRelations**](docs/IfcApi.md#listClassificationElementRelations) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/classification-element | List all associations between classifications and elements
366-
*bimdata.IfcApi* | [**mergeIfcs**](docs/IfcApi.md#mergeIfcs) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/merge | merge IFC files
366+
*bimdata.IfcApi* | [**mergeIfcs**](docs/IfcApi.md#mergeIfcs) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/merge | Merge IFC files
367+
*bimdata.IfcApi* | [**optimizeIfc**](docs/IfcApi.md#optimizeIfc) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/optimize | Optimize the IFC
367368
*bimdata.IfcApi* | [**removeClassificationOfElement**](docs/IfcApi.md#removeClassificationOfElement) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/classification/{id} | Remove a classification from an element
368369
*bimdata.IfcApi* | [**removeElementPropertySet**](docs/IfcApi.md#removeElementPropertySet) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{id} | Remove a PropertySet from an element
369370
*bimdata.IfcApi* | [**removeElementPropertySetProperty**](docs/IfcApi.md#removeElementPropertySetProperty) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{id} | Remove a property from a PropertySet
370371
*bimdata.IfcApi* | [**removeElementPropertySetPropertyDefinition**](docs/IfcApi.md#removeElementPropertySetPropertyDefinition) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{property_pk}/propertydefinition/{id} | Remove a Definition from a Property
371372
*bimdata.IfcApi* | [**removeElementPropertySetPropertyDefinitionUnit**](docs/IfcApi.md#removeElementPropertySetPropertyDefinitionUnit) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{property_pk}/propertydefinition/{propertydefinition_pk}/unit/{id} | Remove a Unit from a Definition
372373
*bimdata.IfcApi* | [**removeElementsFromClassification**](docs/IfcApi.md#removeElementsFromClassification) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/classification/{ifc_classification_pk}/element/{uuid} | Remove the classification from all elements
373-
*bimdata.IfcApi* | [**reprocessIfc**](docs/IfcApi.md#reprocessIfc) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/reprocess | reprocess IFC file
374+
*bimdata.IfcApi* | [**reprocessIfc**](docs/IfcApi.md#reprocessIfc) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/reprocess | Reprocess IFC file
374375
*bimdata.IfcApi* | [**updateAccessToken**](docs/IfcApi.md#updateAccessToken) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/access_token/{token} | Update some fields of a token
375376
*bimdata.IfcApi* | [**updateElement**](docs/IfcApi.md#updateElement) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{uuid} | Update some fields of a zone
376377
*bimdata.IfcApi* | [**updateElementPropertySetProperty**](docs/IfcApi.md#updateElementPropertySetProperty) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{id} | Update a property from an element
@@ -434,6 +435,7 @@ Class | Method | HTTP request | Description
434435
- [bimdata.IfcExport](docs/IfcExport.md)
435436
- [bimdata.IfcFiles](docs/IfcFiles.md)
436437
- [bimdata.IfcMerge](docs/IfcMerge.md)
438+
- [bimdata.IfcOptimize](docs/IfcOptimize.md)
437439
- [bimdata.Invitation](docs/Invitation.md)
438440
- [bimdata.Label](docs/Label.md)
439441
- [bimdata.Layer](docs/Layer.md)

docs/Comment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
77
**guid** | **String** | | [optional]
88
**_date** | **Date** | | [optional]
99
**author** | **String** | | [optional] [readonly]
10-
**comment** | **String** | |
10+
**comment** | **String** | | [optional]
1111
**viewpointGuid** | **String** | | [optional]
1212
**replyToCommentGuid** | **String** | | [optional]
1313
**topicGuid** | **String** | | [optional] [readonly]

docs/Ifc.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ Name | Type | Description | Notes
3838

3939
* `EXPORT` (value: `"EXPORT"`)
4040

41+
* `OPTIMIZED` (value: `"OPTIMIZED"`)
42+
4143

4244

4345

docs/IfcApi.md

Lines changed: 68 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,15 @@ Method | HTTP request | Description
107107
[**getZoneSpaces**](IfcApi.md#getZoneSpaces) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/zone/{zone_pk}/space | Retrieve all spaces of a zone
108108
[**getZones**](IfcApi.md#getZones) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/zone | Retrieve zones of a model
109109
[**listClassificationElementRelations**](IfcApi.md#listClassificationElementRelations) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/classification-element | List all associations between classifications and elements
110-
[**mergeIfcs**](IfcApi.md#mergeIfcs) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/merge | merge IFC files
110+
[**mergeIfcs**](IfcApi.md#mergeIfcs) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/merge | Merge IFC files
111+
[**optimizeIfc**](IfcApi.md#optimizeIfc) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/optimize | Optimize the IFC
111112
[**removeClassificationOfElement**](IfcApi.md#removeClassificationOfElement) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/classification/{id} | Remove a classification from an element
112113
[**removeElementPropertySet**](IfcApi.md#removeElementPropertySet) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{id} | Remove a PropertySet from an element
113114
[**removeElementPropertySetProperty**](IfcApi.md#removeElementPropertySetProperty) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{id} | Remove a property from a PropertySet
114115
[**removeElementPropertySetPropertyDefinition**](IfcApi.md#removeElementPropertySetPropertyDefinition) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{property_pk}/propertydefinition/{id} | Remove a Definition from a Property
115116
[**removeElementPropertySetPropertyDefinitionUnit**](IfcApi.md#removeElementPropertySetPropertyDefinitionUnit) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{property_pk}/propertydefinition/{propertydefinition_pk}/unit/{id} | Remove a Unit from a Definition
116117
[**removeElementsFromClassification**](IfcApi.md#removeElementsFromClassification) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/classification/{ifc_classification_pk}/element/{uuid} | Remove the classification from all elements
117-
[**reprocessIfc**](IfcApi.md#reprocessIfc) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/reprocess | reprocess IFC file
118+
[**reprocessIfc**](IfcApi.md#reprocessIfc) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/reprocess | Reprocess IFC file
118119
[**updateAccessToken**](IfcApi.md#updateAccessToken) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/access_token/{token} | Update some fields of a token
119120
[**updateElement**](IfcApi.md#updateElement) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{uuid} | Update some fields of a zone
120121
[**updateElementPropertySetProperty**](IfcApi.md#updateElementPropertySetProperty) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{id} | Update a property from an element
@@ -6591,9 +6592,9 @@ Name | Type | Description | Notes
65916592

65926593
> mergeIfcs(cloudPk, projectPk, data)
65936594
6594-
merge IFC files
6595+
Merge IFC files
65956596

6596-
Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list. Required scopes: ifc:write
6597+
Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list Required scopes: ifc:write
65976598

65986599
### Example
65996600

@@ -6647,6 +6648,68 @@ null (empty response body)
66476648
- **Accept**: Not defined
66486649

66496650

6651+
## optimizeIfc
6652+
6653+
> optimizeIfc(cloudPk, id, projectPk, data)
6654+
6655+
Optimize the IFC
6656+
6657+
Optimize the IFC. A new optimized IFC file will be put in the same folder that the original IFC Required scopes: ifc:write
6658+
6659+
### Example
6660+
6661+
```javascript
6662+
import bimdata from '@bimdata/bimdata-api-client';
6663+
let defaultClient = bimdata.ApiClient.instance;
6664+
// Configure API key authorization: Bearer
6665+
let Bearer = defaultClient.authentications['Bearer'];
6666+
Bearer.apiKey = 'YOUR API KEY';
6667+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
6668+
//Bearer.apiKeyPrefix = 'Token';
6669+
// Configure OAuth2 access token for authorization: bimdata_connect
6670+
let bimdata_connect = defaultClient.authentications['bimdata_connect'];
6671+
bimdata_connect.accessToken = 'YOUR ACCESS TOKEN';
6672+
// Configure OAuth2 access token for authorization: client_credentials
6673+
let client_credentials = defaultClient.authentications['client_credentials'];
6674+
client_credentials.accessToken = 'YOUR ACCESS TOKEN';
6675+
6676+
let apiInstance = new bimdata.IfcApi();
6677+
let cloudPk = "cloudPk_example"; // String |
6678+
let id = 56; // Number | A unique integer value identifying this ifc.
6679+
let projectPk = "projectPk_example"; // String |
6680+
let data = new bimdata.IfcOptimize(); // IfcOptimize |
6681+
apiInstance.optimizeIfc(cloudPk, id, projectPk, data).then(() => {
6682+
console.log('API called successfully.');
6683+
}, (error) => {
6684+
console.error(error);
6685+
});
6686+
6687+
```
6688+
6689+
### Parameters
6690+
6691+
6692+
Name | Type | Description | Notes
6693+
------------- | ------------- | ------------- | -------------
6694+
**cloudPk** | **String**| |
6695+
**id** | **Number**| A unique integer value identifying this ifc. |
6696+
**projectPk** | **String**| |
6697+
**data** | [**IfcOptimize**](IfcOptimize.md)| |
6698+
6699+
### Return type
6700+
6701+
null (empty response body)
6702+
6703+
### Authorization
6704+
6705+
[Bearer](../README.md#Bearer), [bimdata_connect](../README.md#bimdata_connect), [client_credentials](../README.md#client_credentials)
6706+
6707+
### HTTP request headers
6708+
6709+
- **Content-Type**: application/json
6710+
- **Accept**: Not defined
6711+
6712+
66506713
## removeClassificationOfElement
66516714

66526715
> removeClassificationOfElement(cloudPk, elementUuid, id, ifcPk, projectPk)
@@ -7047,7 +7110,7 @@ null (empty response body)
70477110

70487111
> reprocessIfc(cloudPk, id, projectPk)
70497112
7050-
reprocess IFC file
7113+
Reprocess IFC file
70517114

70527115
Reprocess the IFC. All data that are not in the original IFC files will be lost Required scopes: ifc:write
70537116

docs/IfcMerge.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**ifcIds** | **[Number]** | |
8-
**floatingPointReduction** | **Number** | How many numbers after the decimal point are kept. | [optional]
8+
**floatingPointReduction** | **Number** | Precision of geometries. 6 is micrometre, 9 is nanometre, ect... | [optional]
9+
**exportName** | **String** | |
910

1011

docs/IfcOptimize.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# bimdata.IfcOptimize
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**floatingPointReduction** | **Number** | Precision of geometries. 6 is micrometre, 9 is nanometre, ect... | [optional]
8+
9+

docs/Ruleset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**id** | **Number** | | [optional] [readonly]
8-
**parentRulesetId** | **String** | | [optional]
8+
**parentRulesetId** | **Number** | | [optional]
99
**name** | **String** | |
1010
**description** | **String** | | [optional]
1111
**rules** | [**[Rule]**](Rule.md) | | [optional]

src/api/IfcApi.js

Lines changed: 75 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import IfcErrors from '../model/IfcErrors';
2323
import IfcExport from '../model/IfcExport';
2424
import IfcFiles from '../model/IfcFiles';
2525
import IfcMerge from '../model/IfcMerge';
26+
import IfcOptimize from '../model/IfcOptimize';
2627
import Layer from '../model/Layer';
2728
import ProcessorHandler from '../model/ProcessorHandler';
2829
import Property from '../model/Property';
@@ -7296,8 +7297,8 @@ export default class IfcApi {
72967297

72977298

72987299
/**
7299-
* merge IFC files
7300-
* Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list. Required scopes: ifc:write
7300+
* Merge IFC files
7301+
* Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list Required scopes: ifc:write
73017302
* @param {String} cloudPk
73027303
* @param {String} projectPk
73037304
* @param {module:model/IfcMerge} data
@@ -7341,8 +7342,8 @@ export default class IfcApi {
73417342
}
73427343

73437344
/**
7344-
* merge IFC files
7345-
* Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list. Required scopes: ifc:write
7345+
* Merge IFC files
7346+
* Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list Required scopes: ifc:write
73467347
* @param {String} cloudPk
73477348
* @param {String} projectPk
73487349
* @param {module:model/IfcMerge} data
@@ -7356,6 +7357,74 @@ export default class IfcApi {
73567357
}
73577358

73587359

7360+
/**
7361+
* Optimize the IFC
7362+
* Optimize the IFC. A new optimized IFC file will be put in the same folder that the original IFC Required scopes: ifc:write
7363+
* @param {String} cloudPk
7364+
* @param {Number} id A unique integer value identifying this ifc.
7365+
* @param {String} projectPk
7366+
* @param {module:model/IfcOptimize} data
7367+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
7368+
*/
7369+
optimizeIfcWithHttpInfo(cloudPk, id, projectPk, data) {
7370+
let postBody = data;
7371+
// verify the required parameter 'cloudPk' is set
7372+
if (cloudPk === undefined || cloudPk === null) {
7373+
throw new Error("Missing the required parameter 'cloudPk' when calling optimizeIfc");
7374+
}
7375+
// verify the required parameter 'id' is set
7376+
if (id === undefined || id === null) {
7377+
throw new Error("Missing the required parameter 'id' when calling optimizeIfc");
7378+
}
7379+
// verify the required parameter 'projectPk' is set
7380+
if (projectPk === undefined || projectPk === null) {
7381+
throw new Error("Missing the required parameter 'projectPk' when calling optimizeIfc");
7382+
}
7383+
// verify the required parameter 'data' is set
7384+
if (data === undefined || data === null) {
7385+
throw new Error("Missing the required parameter 'data' when calling optimizeIfc");
7386+
}
7387+
7388+
let pathParams = {
7389+
'cloud_pk': cloudPk,
7390+
'id': id,
7391+
'project_pk': projectPk
7392+
};
7393+
let queryParams = {
7394+
};
7395+
let headerParams = {
7396+
};
7397+
let formParams = {
7398+
};
7399+
7400+
let authNames = ['Bearer', 'bimdata_connect', 'client_credentials'];
7401+
let contentTypes = ['application/json'];
7402+
let accepts = [];
7403+
let returnType = null;
7404+
return this.apiClient.callApi(
7405+
'/cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/optimize', 'POST',
7406+
pathParams, queryParams, headerParams, formParams, postBody,
7407+
authNames, contentTypes, accepts, returnType, null
7408+
);
7409+
}
7410+
7411+
/**
7412+
* Optimize the IFC
7413+
* Optimize the IFC. A new optimized IFC file will be put in the same folder that the original IFC Required scopes: ifc:write
7414+
* @param {String} cloudPk
7415+
* @param {Number} id A unique integer value identifying this ifc.
7416+
* @param {String} projectPk
7417+
* @param {module:model/IfcOptimize} data
7418+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
7419+
*/
7420+
optimizeIfc(cloudPk, id, projectPk, data) {
7421+
return this.optimizeIfcWithHttpInfo(cloudPk, id, projectPk, data)
7422+
.then(function(response_and_data) {
7423+
return response_and_data.data;
7424+
});
7425+
}
7426+
7427+
73597428
/**
73607429
* Remove a classification from an element
73617430
* The classification will not be deleted Required scopes: ifc:write
@@ -7855,7 +7924,7 @@ export default class IfcApi {
78557924

78567925

78577926
/**
7858-
* reprocess IFC file
7927+
* Reprocess IFC file
78597928
* Reprocess the IFC. All data that are not in the original IFC files will be lost Required scopes: ifc:write
78607929
* @param {String} cloudPk
78617930
* @param {Number} id A unique integer value identifying this ifc.
@@ -7901,7 +7970,7 @@ export default class IfcApi {
79017970
}
79027971

79037972
/**
7904-
* reprocess IFC file
7973+
* Reprocess IFC file
79057974
* Reprocess the IFC. All data that are not in the original IFC files will be lost Required scopes: ifc:write
79067975
* @param {String} cloudPk
79077976
* @param {Number} id A unique integer value identifying this ifc.

src/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import IfcErrors from './model/IfcErrors';
4545
import IfcExport from './model/IfcExport';
4646
import IfcFiles from './model/IfcFiles';
4747
import IfcMerge from './model/IfcMerge';
48+
import IfcOptimize from './model/IfcOptimize';
4849
import Invitation from './model/Invitation';
4950
import Label from './model/Label';
5051
import Layer from './model/Layer';
@@ -334,6 +335,12 @@ export {
334335
*/
335336
IfcMerge,
336337

338+
/**
339+
* The IfcOptimize model constructor.
340+
* @property {module:model/IfcOptimize}
341+
*/
342+
IfcOptimize,
343+
337344
/**
338345
* The Invitation model constructor.
339346
* @property {module:model/Invitation}

src/model/Comment.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,18 @@ class Comment {
2222
/**
2323
* Constructs a new <code>Comment</code>.
2424
* @alias module:model/Comment
25-
* @param comment {String}
2625
*/
27-
constructor(comment) {
26+
constructor() {
2827

29-
Comment.initialize(this, comment);
28+
Comment.initialize(this);
3029
}
3130

3231
/**
3332
* Initializes the fields of this object.
3433
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
3534
* Only for internal use.
3635
*/
37-
static initialize(obj, comment) {
38-
obj['comment'] = comment;
36+
static initialize(obj) {
3937
}
4038

4139
/**

0 commit comments

Comments
 (0)