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.
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:
specklesystems:main
â specklesystems:viewer-redux-integration
opened 08:57AM - 01 Sep 22 UTC
<!---
Provide a short summary in the Title above. Examples of good PR titles:âŚ
* "Feature: adds metrics to component"
* "Fix: resolves duplication in comment thread"
* "Update: apollo v2.34.0"
-->
## Description & motivation
A completely revamped 3D viewer. New viewer [API docs are here](https://www.notion.so/speckle/Viewer-API-Documentation-11f7bcbf3d2547c2985b0c988fb9889e).
<!---
Describe your changes, and why you're making them. What benefit will this have to others?
Is this linked to an open Github issue, a thread in Speckle community,
or another pull request? Link it here.
If it is related to a Github issue, and resolves it, please link to the issue number, e.g.:
Fixes #85, Fixes #22, Fixes username/repo#123
Connects #123
-->
## TODOs
- [x] fix linting errors in PropertyManager.ts
- [x] ensure colour hashes are generated consistently in a non-random fashion based on input values
- [x] re-add ghosting params to filtering manager
- [x] re-add real time user object selection highlight
- [x] center bubbles on selection
- [x] update viewer package readme
- [ ] update docs https://speckle.guide/dev/js.html (TODO after merge)
## Validation of changes:
Local testing with various streams. When merged into main, "fuzz" testing on latest will start.
## Checklist:
<!---
This checklist is mostly useful as a reminder of small things that can easily be
forgotten â it is meant as a helpful tool rather than hoops to jump through.
Put an `x` between the square brackets, e.g. [x], for all the items that apply,
make notes next to any that haven't been addressed, and remove any items that are not relevant to this PR.
-->
- [x] My pull request follows the guidelines in the [Contributing guide](https://github.com/specklesystems/speckle-server/blob/main/CONTRIBUTING.md)?
- [x] My pull request does not duplicate any other open [Pull Requests](../../pulls) for the same update/change?
- [x] My commits are related to the pull request and do not amend unrelated code or documentation.
- [x] My code follows a similar style to existing code.
- [x] I have updated or added relevant documentation.
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:
The Speckle Server, Frontend, 3D Viewer, & other JS utilities. - Issues ¡ specklesystems/speckle-server
1 Like
gokermu
(Mucahit Bilal GOKER)
26 September 2022 08:15
5
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.
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