Space Boundary Segments in API not consistent with UI

Space Boundary Segments in API not consistent with UI

grahamcook
Advocate Advocate
2,831 Views
11 Replies
Message 1 of 12

Space Boundary Segments in API not consistent with UI

grahamcook
Advocate
Advocate

Hi

 

The attached image shows a selected Space object with 3 boundary loops (one outer boundary, two inner boundaries).  When I attempt to get the boundary segments of the same Space through the API, only two loops are returned as you can see from the bottom part of the image.  Reading the following post I can see that there are unresolved issues with Room / Space boundary detection when it comes to small tolerances but in this case the UI has successfully determined 3 boundaries whereas the API only returns 2?  I'm running Revit 2017.2.  Attached is a sample file.

 

BoundaryLoopsIssue1.jpg

 

 

0 Likes
Accepted solutions (1)
2,832 Views
11 Replies
Replies (11)
Message 2 of 12

jeremytammik
Autodesk
Autodesk

Dear Graham,

 

Thank you for your report.

 

Have you tried the other SpatialElementBoundaryLocation options?

 

Check out this discussion:

 

http://thebuildingcoder.typepad.com/blog/2016/04/determining-wall-cut-area-for-a-specific-room.html

 

It says:

 

"You have to set the SpatialElementBoundaryLocation = SpatialElementBoundaryLocation.Center to close the geometry, and it does not work for Finish."

 

I hope this helps.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 12

grahamcook
Advocate
Advocate

Thank you Jeremy

 

I don’t usually set the SpatialElementBoundaryLocation but started playing with the option in the hope that it might resolve the issue.

 

Here are some things I tried with varying results:

  1. Set SpatialElementBoundaryLocation to Centre – Results in 2 boundaries each with 4 segments (see image 1 below - there are separator lines between the two bottom free standing walls BTW).  Has the effect of ignoring the top single leaf wall (I assume because it’s a standalone wall and its centre line forms no closed loops – expected behaviour I guess).
  2. Do not set SpatialElementBoundaryLocation (defaults to Finish) – results in 2 boundaries, outer with 4 segments, inner with 8 segments that overlap (See image 2 below).
  3. Set SpatialElementBoundaryLocation to Finish – same result as above.
  4. Do not set SpatialElementBoundaryLocation (defaults to Finish) and increase the distance between the walls by 10mm to 310mm - Results in 3 clean separate boundaries all with 4 segments.  (See Image 3 below).  This is the result I want.
  5. As 4 above but set SpatialElementBoundaryLocation to Centre - Results in 2 boundaries each with 4 segments (same as 1 above).

 

So, because it’s the inside face I’m interested in, SpatialElementBoundaryLocation.Finish is the setting I need and by slightly increasing the gap between the walls to 310mm the API returns what the UI appears to indicate on the screen (when selecting the Space).  Doesn’t help me though because the gap needs to be 300mm or less!  I’ll have to try and detect this scenario and extract the two boundaries from the returned overlapping inner boundary (perhaps using the Clipper library).

 

Correcting the issue by moving the wall does point towards a tolerance issue but its annoying that the UI and API return different apparent results.

 

Image 1Image 1Image 2Image 2Image 3Image 3

0 Likes
Message 4 of 12

jeremytammik
Autodesk
Autodesk

Dear Graham,

 

Thank you for your update and careful analysis.

 

Yes, I can see how that is very annoying.

 

I would like to submit this issue to the development team for further analysis on their side.

 

Can you please provide a minimal full reproducible case including a simple sample model and detailed instructions how they can reproduce the behaviour you see?

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

Thank you!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 5 of 12

grahamcook
Advocate
Advocate

Jeremy

 

Thanks for running it by the development team.  Attached is a sample file.  I have moved the relevant Add-In code into a Macro which is self contained within the file.

 

  1. Open file (2017)
  2. Macro Manager, select Macro DrawBoundaries
  3. Select the Space (there is only one drawn in the model)
  4. The macro will draw the boundaries as model lines.  Note that there will be two boundary loops as detailed in my post above (there should be 3).  The API has incorrectly combined the two inner boundaries into one loop with overlapping segments.
  5. Undo the changes to return back to a clean model.
  6. A "Fix" is to increase the gap between the two top walls.
  7. Move the top standalone wall up by 10mm thus creating a 310mm gap.
  8. Re-Run the macro
  9. The API now correctly detects 3 Boundary loops which is the desired result.
  10. It's easy enough to debug through by placing a break point at line 65 and observing the segArray count.

 

As background info, the Full AddIn is used by a floor manufacture who design and supplier beam and block flooring.  The space object defines the floor bay for which the beam span, spacing and floor types are calculated and placed automatically trying to avoiding obstructions and other beams in adjacent bays.  Thus the importance of the Boundaries!

 

Capture.JPG

Message 6 of 12

jeremytammik
Autodesk
Autodesk

Dear Graham,

 

Thank you for your update and nice clean reproducible case with perfect step by step description.

 

I logged the issue REVIT-127340 [API space boundary differs from UI -- 13927409] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software. Please make a note of this number for future reference.

 

You are welcome to request an update on the status of this issue or to provide additional information on it at any time quoting this change request number.

 

This issue is important to me. What can I do to help?

 

This issue needs to be assessed by our engineering team and prioritised against all other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:

 

  • Impact on your application and/or your development.
  • The number of users affected.
  • The potential revenue impact to you.
  • The potential revenue impact to Autodesk.
  • Realistic timescale over which a fix would help you.
  • In the case of a request for a new feature or a feature enhancement, please also provide detailed Use cases for the workflows that this change would address.

 

This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 7 of 12

jeremytammik
Autodesk
Autodesk

Dear Graham,

 

You ask why you were notified that the associated ADN case 13927409 [Space Boundary Segments in API not consistent with UI] was closed.

 

Whether the ADN case is open or closed makes no difference as long as we are aware of its existence and case number.

 

You can reopen, update and add any new information you wish to it at any time you like regardless.

 

I much prefer communicating all non-confidential information with you over the public forum, though, so that others can share and contribute as well.

 

Furthermore, the status of the ADN case in no way affects the internal development issue REVIT-127340 [API space boundary differs from UI -- 13927409]. The development team only care about the latter. I have not had any feedback from them on it yet, though. I will let you know as soon as I hear anything.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 8 of 12

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Graham,

 

Thank you for your patience.

 

The development team finished analysing your issue REVIT-127340 [API space boundary differs from UI -- 13927409] and say:

 

A.

 

This is an excellent reproducible case!

 

I reproduced the issue and investigated the code a little bit. It seems that the root cause has to do with the topology of the room. The API function called to retrieve the segments depends on the previously computed topology.

 

To trace the code, I put in breakpoints and ran the macro. I also changed the dimension from 300 to 310 and back.

 

I traced how the topology is computed...

 

I can see that depending on the position of the stand-alone wall (which is offset by either 300 or 310 mm) the topology switches between two components and three components. It looks to me like the stand-alone wall produces a possibly degenerate two-segment circuit that is sometimes combined with another circuit to make a circuit with six segments.

 

Since the algorithm has many cases (needed to support different kinds of geometry) and includes tolerances and performance optimizations, I think that fixing this issue should be classified as an improvement.

 

B.

 

Actually, there is no difference between boundaries used by the UI and API. The boundary is less than ideal due to the 1ft (about 300mm) gap closing tolerance. The space in the model here also has those overlapping lines on the left side of the "islands" except they are not displayed in 2D view. Internally the same code provides the boundary curves to the Space/Room elements as the one used by the API.

 

Nothing really to fix here, except the old problem of the 1ft tolerance. That has been reported numerous times and waiting in our backlog to gather enough support.

 

I therefore closed this issue now as 'Won't Fix'.

 

I hope this clarifies.

 

You might want to add your support to the Revit Idea station wish list item to modify the 1ft tolerance mentioned above, or create such a wish if none yet exists.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 9 of 12

grahamcook
Advocate
Advocate

Thank you Jeremy.

 

I will add my vote.  In fact, this is the only one I can find which looks similar.  Below is the link for those that land on this post and would also like to vote in the hope that we finally get some control over the Room / Space boundary detection tolerance.  99% of the time it works as is, it's that project that has tight spaces / unconventional layouts where we would like to adjust the 1ft tolerance in order to get the result we need.

 

https://forums.autodesk.com/t5/revit-ideas/remove-minimum-room-dimension/idi-p/7233742

 

 

0 Likes
Message 10 of 12

jeremytammik
Autodesk
Autodesk

Dear Graham,

 

Thank you for your update and checking the wish list.

 

It is hard to say whether the existing wish covers the same issue as you raise.

 

I would raise a new issue in addition to the existing one, and refer to the development issue REVIT-127340 [API space boundary differs from UI -- 13927409]. In the new wish list item, you can quote Tamas Badics as saying, 'Nothing really to fix here, except the old problem of the 1ft tolerance. That has been reported numerous times and is waiting in our backlog to gather enough support.'

 

In the existing wish list item, you can add a pointer to the new one, saying that they may be related, and asking everybody interested in either of them to vote for both of them.

 

What do you think? Does that make sense?

 

Thank you!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 11 of 12

tamas_badics
Autodesk
Autodesk

Hi Jeremy and Graham,

 

First of all, thank you both for the clean description and easily reproducible problem report. I looked at it yesterday and unfortunately I do not have any better news than what you already know. In short, while the space element in the live session appears to have different boundary than the segments returned by the API call, in fact it has the same and only the display mechanism cancels out the overlapping portion between the standalone wall and the "island". 

I also verified that the API call reaches to the same code that is used to prepare the rooms/spaces in by the UI. 

 

On the subject of the 300mm or less channels, it is the result of how Revit computes room boundaries internally. While it is less than ideal, it produces reasonable 2D boundaries in the vast majority of cases. 

 



Tamás Badics

Software Architect, Revit
0 Likes
Message 12 of 12

grahamcook
Advocate
Advocate

As suggested, I have created a new post on the Ideas section suggesting that an option be added to adjust the tolerance.  Here's a link for those that would also like to add their weight!

 

https://forums.autodesk.com/t5/revit-ideas/lift-the-1ft-tolerance-relating-to-room-and-space-boundar...