Hello, I want to have a small filter allowing people to select the correct classes proposed in the IFC Schema. I want to use bSDD in order to not having to downloadI FC Schema, making the application more logical.
The problem I encounter is the limit of a 1000 items.
Here is my code :
import requests
# Define the API endpoint
url = 'https://api.bsdd.buildingsmart.org/api/Dictionary/v1/Classes?Uri=https%3A%2F%2Fidentifier.buildingsmart.org%2Furi%2Fbuildingsmart%2Fifc%2F4.3'
response = requests.get(url)# Send the GET request
if response.status_code == 200: # Successful request
data = response.json() # The response is in JSON format
classes = data.get('classes',[])
IfcClasses = []
for c in classes :
name = c.get('referenceCode')
print(name)
IfcClasses.append(name)
This then does not give the complete list to filter correctly.
I also tried to use the /api/Class/Search/v1
The problem is that this does not work with only the ReferenceCode :
If the user search âSlabâ, it will give me back all of the classes that mention something about slabs, like :
{
"dictionaryUri": "https://identifier.buildingsmart.org/uri/buildingsmart/ifc/4.3",
"dictionaryName": "IFC",
"name": "Edgebeam",
"referenceCode": "IfcBeamEDGEBEAM",
"uri": "https://identifier.buildingsmart.org/uri/buildingsmart/ifc/4.3/class/IfcBeamEDGEBEAM",
"classType": "Class",
"description": "A beam on the longitudinal edge of bridge slab, usually concrete, providing additional stiffening and protection from the elements.",
"parentClassName": "Beam",
"relatedIfcEntityNames": []
},
The 1000 limit is for pagination of the results, which is a common practice not to overload the transfer if you encounter a dictionary with many thousands of results. Simply check the number of results returned (âclassesTotalCountâ for IFC: 2163) and request second and third page. For example:
I understand better. Do you know if there is an example of how to use this ? I am not to familiar with this filtering for example
In your example of search for instance, you find yourself with results that donât have the slab word in the part reference code (like IfcBeam doesnât have slab in it). It is impractical to filter.
yes, you control pagination with limit and offset. Limit says about ânumber of items to be returnedâ and Offset is a âzero-based offset of the first item to be returned.â
A secondary question in the same line of thinking :
Is there a way to get a list of the different propertysets of a class easily ?
because with the endpoint : âhttps://api.bsdd.buildingsmart.org/api/Class/v1â you can ask for the class properties, that gives you every properties and for each of their respective propertysets :
but you would have to skim trough every property and find out what is its propertyset in order to retrieve the complete list, which seems very impractical.