Community
Forma Developer Forum
Welcome to Autodesk Forma Developer Forum. Share your knowledge, ask questions, and explore popular Forma API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I allow the user to create a Site Limit inside an extension?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
iklimis
220 Views, 3 Replies

How do I allow the user to create a Site Limit inside an extension?

Hello Forma Team, 
We had a great with you guys in Oslo! You guys were most welcome


So a need arose where we need the user to select an area (or a polygon ..) of 'interest' on the site. 
After some experimenting I found that the Site Limit tool you have is exactly what we need. But we do need the user to use an action inside our extension in a specific time to make that area selection. 

I noticed also this actually makes a geojson which would be extra helpful to keep for reference.

1. Can you suggest a way where i can invoke the create "site limit" functionality to allow user to select this sub-area?
2. What would be the optimal way to get the produced geojson (or path) of the selected area in case the user wants to change it ?

Thanks a lot !!
Giannis



 

 

Tags (2)
Labels (1)
3 REPLIES 3
Message 2 of 4
vilde.barth
in reply to: iklimis

Hi!

 

Glad to hear that you had a great time at the Hackathon, it was a lot of fun!

 

1. We do not have support for invoking the in-product site limit tool, but we expose the design tool in getPolygon as described in the other post. 

 

2. In order to access the elements the user select in the scene, you can use the SelectionAPI to get the user selection and then you can use the getFootprint method in the GeometryAPI to get the coordinates of the selected polygon. Does this solve your need? You can also subscribe to changes on the proposal if you would like to detect changes on the site limit element (or other elements). 

 

Not sure if I answered exactly what you wanted, feel free to describe the flow you want to accomplish more in detail if you believe that will help us to understand the need 🙂

Best, Vilde 

Message 3 of 4
vilde.barth
in reply to: vilde.barth

By using the getPolygon, you activate the same tool as using the site limit tool in the product, the difference is that it just returns the polygon to you and do not persist it as a site limit in the proposal. Not sure if that is what you want to accomplish in this case?
Message 4 of 4
iklimis
in reply to: iklimis

@vilde.barth Hey!

Yes, I went the same direction using basically the getPolygon for creating  a shape taking the points and going forward creating the elements...

Thanks a lot for your reply

Giannis

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums