Unexpected behavior: SlabEdge not collected by ElementIntersectsSolidFilter

Unexpected behavior: SlabEdge not collected by ElementIntersectsSolidFilter

respresso
Contributor Contributor
829 Views
11 Replies
Message 1 of 12

Unexpected behavior: SlabEdge not collected by ElementIntersectsSolidFilter

respresso
Contributor
Contributor

It seems that SlabEdge behaves unexpectedly when I tried to filter for it with an ElementIntersectsSolidFilter. It is ignored even when it should intersect with a solid. I created a thin slice of solid by extruding the crop shape of a view, and expect both the 356884 (Floor) and 356986 (SlabEdge) to intersect with this solid, but only the former gets collected, the latter did not, as shown in the dialog running this code. The expectation is both 356884 and 356986 are collected from the ElementIntersectsSolidFilter, a reasonable expectation isn't it?

(I included a minimal Rvt file to reproduce this). Any help is appreciated!

result.png

 

 

 

    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class ExternalCommand : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            var doc = commandData.View?.Document;
            if (null == doc)
            {
                return Result.Cancelled;
            }
            var view = doc.ActiveView;

            ViewCropRegionShapeManager cropRegionShapeManager = view.GetCropRegionShapeManager();
            IList<CurveLoop> CropShape = cropRegionShapeManager.GetCropShape();
            Solid slice = GeometryCreationUtilities.CreateExtrusionGeometry(CropShape, view.ViewDirection.Negate(), 0.1);

            FilteredElementCollector allelements = new FilteredElementCollector(doc, doc.ActiveView.Id);
            FilteredElementCollector intersected = new FilteredElementCollector(doc, doc.ActiveView.Id)
                .WherePasses(new ElementIntersectsSolidFilter(slice));

            MessageBox.Show($"All Elements:\n{ElementsToString(allelements)}\n\n" +
                            $"\nIntersected Elements:\n{ElementsToString(intersected)}");

            return Result.Succeeded;
        }

        private string ElementsToString(FilteredElementCollector collector)
        {
            return string.Join(",\n", collector.ToElements().Select(e => $"{e.Id} {e.Category?.Name} - {e.Name}"));
        }
    }

 

 

 

0 Likes
830 Views
11 Replies
Replies (11)
Message 2 of 12

jeremy_tammik
Alumni
Alumni

It also depends on the Z coordinates. You do not show those. Maybe the slab edge is higher or lower than the slice.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 12

RPTHOMAS108
Mentor
Mentor

Hello @jeremy_tammik@respresso 

 

I looked at this and found the same issue. There is a note about the ElementIntersectsSolidFilter only working with elements which have solid geometry, however SlabEdges do have solid geometry.

 

When I tried the original code similar to that provided by @respresso  using .GetCropShape I found no intersection with Floor or SlabEdge (I did upgrade the file so maybe something changed there).

 

So instead of .GetCropShape I am using .GetAnnotationCropShape but there is still no intersection found between the SlabEdge and Solid. To clarify the position of the geometry of solid created from annotation crop shape and slab edge the macro attached will generate DirectShape objects to show the intersection.

 

So I think this needs further investigation or a clarification of what types of Element this filter does not currently work with. 

0 Likes
Message 4 of 12

jeremy_tammik
Alumni
Alumni

Wow! Thank you very much for researching and clarifying this.

 

I will certainly raise a development issue for this asap. Unfortunately, I am unable to do so right now, since I will be away for a break the coming weeks. Please help me not overlook it when I return and get inundated with other pressing matters.

 

I wish you a wonderful and peaceful time and  hope that the forum will be able to manage for the next couple of weeks without me; back mid-August...

 

Cheers,

 

Jeremy

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 5 of 12

RPTHOMAS108
Mentor
Mentor

Thanks Jeremy. I'll try and remember this for when you get back, enjoy your time away.

0 Likes
Message 6 of 12

RPTHOMAS108
Mentor
Mentor

Hello @jeremy_tammik 

 

Just a reminder of this issue as requested. Note that I tried this without setting the collector to a specific view and there was still no inclusion of the slab edge in the results.

 

Seems odd because slab edge has solid geometry.

 

I note this wording from RevitAPI.chm:

"some combinations of elements will never be detected as intersecting by this filter, such as concrete members which are automatically joined at their intersections"

 

However I take this to mean that a floor tested against a slab edge will not return the slab edge as intersecting. I wonder however if to rule such erroneous things out SlabEdges have been omitted altogether. Also SlabEdge is a subcategory of floor so perhaps the floor is considered but the slab edge overlooked.

 

However I think it is important to find intersections between slab edges and other things e.g. ground bearing slab edge thickenings and below ground services exiting the perimeter of a building. 

 

0 Likes
Message 7 of 12

jeremy_tammik
Alumni
Alumni

Thank you very much for the reminder and explanation. I'll pick this up asap.

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 8 of 12

jeremy_tammik
Alumni
Alumni

Dear @respresso, dear Richard,

 

Thank you for your report, sample material and careful analysis.

 

I logged the issue REVIT-181888 [ElementIntersectsSolidFilter ignores SlabEdge] 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.

 

Best regards,

 

Jeremy

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 9 of 12

respresso
Contributor
Contributor

@RPTHOMAS108 Thanks for confirming, rationalizing and following up with this report. Much appreciated.

 

@jeremy_tammik Thanks for logging this. Here let me provide more information as follows.

 

  • Impact on your application and/or your development.

We have to pause any effort fixing a bug our users reported, that they expect the addin "see" the SlabEdge, while the addin could not "see" them.

 

  • The number of users affected.

We currently have close to 100 users. Bug is reported from one of them, but we expect a considerable portion get this problem.

 

  • The potential revenue impact to you.

It hinders the growth of our revenue. If a user couldn't get confident in our product's performance, it is less likely they would recommend it to their colleagues and friends.

 

  • The potential revenue impact to Autodesk.
  • Realistic timescale over which a fix would help you.

Preferably in a few (<6) months.

 

  • 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.

We automated the process of drawing interior elevation outlines, so the workflow gets compressed into one click of the button. This capability relies on being able to read geometries from the model via Revit API, and is facilitated by APIs to calculate plane intersected elements (ideally and crucially including any SlabEdge).

0 Likes
Message 10 of 12

respresso
Contributor
Contributor

@RPTHOMAS108 wrote:

 

So I think this needs further investigation or a clarification of what types of Element this filter does not currently work with


That would be very helpful to us developing applications. Perhaps, Autodesk would share with us a list of these types this filter does work with, which should serve as the clarification.

0 Likes
Message 11 of 12

jeremy_tammik
Alumni
Alumni

Thank you for your business case and the request for clarification.

 

I added them both to the new development issue that the development team created to perform the work in:

 

  • REVIT-182563 [ElementIntersectsSolidFilter ignores SlabEdge]

 

Please make a note of this number for future reference.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 12 of 12

jeremy_tammik
Alumni
Alumni

Here are two files shared by the devteam:

 

  • InterferenceCheckCategories_r2022.txt
  • InterferenceCheckCategories_r2023.txt

 

They contain the lists of categories returned by InterferenceReport::getListOfSupportedCategories for Revit 2022 and Revit 2023, respectively. As far as I know, those are the categories that Revit's interference checker recognises. The list for Revit 2021 is the same as for Revit 2022. I think this is the information you want.

 

For Revit 2023, two categories were added:

 

  • OST_PlumbingEquipment
  • OST_MechanicalControlDevices 

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes