How to get SteelProxyElement geometry

How to get SteelProxyElement geometry

Anonymous
Not applicable
890 Views
4 Replies
Message 1 of 5

How to get SteelProxyElement geometry

Anonymous
Not applicable

I try to acces to the geometry of a SteelProxyElement. 

To do this i use  this portion of code

        IOrderedEnumerable<Element> GetAllModelElements(Document doc)
        {
            List<Element> elements = new List<Element>();

            FilteredElementCollector collector
              = (FilteredElementCollector)new FilteredElementCollector(doc)
              .WhereElementIsNotElementType();

            Options options = new Options();
            if (null != options)
            {
                options.ComputeReferences = true;
                options.DetailLevel = ViewDetailLevel.Fine;
            }
            foreach (Element e in collector)
            {
                if ((e.Category!=null) &&(e.Category.Name.ToUpper()=="PLATINES"))
                {
                    elements.Add(e);
                }

                if (e.get_Geometry(options) != null)
                {
                    elements.Add(e);
                }
            }
            return elements.OrderBy(e => e.Category.Name);
        }

e.get_Geometry return null for SteelProxyElement why ?

Thanks

Fred

0 Likes
891 Views
4 Replies
Replies (4)
Message 2 of 5

jeremy_tammik
Alumni
Alumni

I am not familiar with steel proxy elements. A proxy is a placeholder. Maybe the placeholder has no own geometry? Have you explored the elements, its geometry, properties and relationships with RevitLookup and other tools.

 

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

Anonymous
Not applicable
 

Yes, here a screen copy.

but the get_Geometry(_opt) return always null. and i don't know why.

thanks for your answer.

 

image.png

0 Likes
Message 4 of 5

heziTYJKR
Contributor
Contributor

Hi, did you find a solution for that? I am also facing the same issue.

SteelProxyElement is not even documented in the API docs 😕

0 Likes
Message 5 of 5

matthew_taylor
Advisor
Advisor

If you look at the SteelProxyElement in Revit 2023 RevitLookup when the SteelProxyElement is visible in the active view, the geometry will exist:
SteelProxyElement.png
In the code itself, you may need to iterate through views (using each view in DB.Options with elem.Geometry(options)) to get a valid geometry element.


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
0 Likes