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

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

iklimis
Advocate Advocate
579 Views
3 Replies
Message 1 of 4

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

iklimis
Advocate
Advocate

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



 

 

0 Likes
Accepted solutions (2)
580 Views
3 Replies
Replies (3)
Message 2 of 4

vilde.barth
Autodesk
Autodesk
Accepted solution

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 

0 Likes
Message 3 of 4

vilde.barth
Autodesk
Autodesk
Accepted solution
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?
0 Likes
Message 4 of 4

iklimis
Advocate
Advocate

@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

0 Likes