Best way to get an Element properties from a Revit GUID

Hi friends!
So im building a web app using the speckle viewer, i have a list of Revit GUID elements and from that i need to get access to the element properties.
As i understand i will need to get a speckle object first to access the properties afterwards but im not sure how to do that without filtering the viewer (i just need the properties no element isolation in the viewer)

any help is appreciated

Thanks!

2 Likes

Hi @Ricardo_Zepeda! The viewer API is changing - we’re rolling out a much improved viewer. Preliminary docs are here.

The part you’re looking for is at the end, specifically:


const dataTree = viewer.getDataTree()
// Get all mesh speckle objects
const objects = dataTree.findAll((guid, obj) => {
	return obj.speckle_type === 'Objects.Geometry.Mesh'
})

You will basically want to replace that part with an applicationId check. The returned objects will be the ones you need, inc. their props.

@alex and/or I will be happy to help out next week more. Mind you, this new viewer is not yet released, but it’s available here for now:

We will have an npm release next week!

3 Likes

Thanks a lot! @dimitrie very exiting stuff in the docs! do you now if there is a public dev roadmap for the viewer? .

P.S. i manage to get the revit GUID from v.sceneManager.AllObjects and then filter by the id. maybe not efficient but it did the job.

3 Likes

Of course there is - our viewer’s inside the speckle-server monorepo on our github organization. You can check the currently planned issues by filtering them with the [ viewer ] label, like this:

1 Like

Hi @Ricardo_Zepeda,

Our improved viewer is live on latest for testing🚀. Docs (alpha) for the viewer is also below. Feel free to test it and let us know if you need any help.

:pushpin: Parts of viewer may change as it’s not in its final shape yet. We do not recommend using it in production workflows.

1 Like

Thanks for the update @gokermu! will do the update and test to see how it works

1 Like