Hi,
I am trying to load a floor from a building model in my react js app using 3d viewer.
I am not sure how to find the floor (object)id so that it loads only that floor in viewer instead of loading the whole building at once which is approx 1.5gb and it takes time.
My application is basically comparing 360 image with model.
e.g on left side we load the 360 image of a room and on right side we want to load model of a room/floor.
I did find one approach from where i get all the ids by selecting the floor in filters and then use these ids comma seperated in SpeckleLoader but it is too slow, it looks like it loads model one by one in this case.
I’m going to detail a bit solution which uses the speckle viewer library, since I see you mention you are building your own web application.
Instead of passing a bunch of objects, comma separated to the SpeckleLoader you can just pass a common parent id of these objects. Like for example an URL of the form
Will load the object 8247bbc53865b0e0cb5ee4e252e66216 along with any children it may have.
So in your case, if you organize each floor objects under a common parent (which doesn’t need to be displayable) and pass that object id to the loader it will load all it’s children. Maybe you already have the floors organized like this, have a look.
Thanks Alex,
this is what i’m looking into since Jonathan mentioned graphql api, so i’ve able to filter all the objects using level id.
// variables
{
"projectId": "6714b0f0ec",
"objectId": "254766ed628e1787af5c6314719cc244",
"query": [
{
"field":"level.id",
"value":"0e966ae9dc77be0aaf34a366f4ac08e5",
"operator":"="
}
]
}
// query
query Query($projectId: String!, $objectId: String!, $query: [JSONObject!]) {
project(id: $projectId) {
object(id: $objectId) {
id
totalChildrenCount
children(query:$query) {
totalCount
objects {
id
data
speckleType
createdAt
totalChildrenCount
children {
objects {
children {
objects {
id
speckleType
createdAt
totalChildrenCount
data
}
}
}
}
}
}
data
createdAt
speckleType
}
}
}
I’ve not been able locate the Object Id of a floor and it seems there isn’t a common parent already but it feels good to know that i’m heading into right direction.
So right now the idea is to group these objects in response under one common parent,
looks like this mutation might do the job: objectCreate: [String!]!
but its deprecated.
I am thinking of writing a custom mutation which does the following
@Muhammad_Adnan, with the new version of our connectors we’re structuring revit data out as by default via levels, so this adventure becomes a bit easier as each level will have its id.
Dimitrie was referring to the Next Gen v3 connectors in the form of a Revit connector. I don’t think there are plans to backport these changes into the v2 form.