When I draw a roof by footprint on the revit API HostObjectUtils malfunctions

When I draw a roof by footprint on the revit API HostObjectUtils malfunctions

WorldDue
Enthusiast Enthusiast
357 Views
0 Replies
Message 1 of 1

When I draw a roof by footprint on the revit API HostObjectUtils malfunctions

WorldDue
Enthusiast
Enthusiast

Hello,

 

I am trying to extract each planar face of a roof drawn by a class I made (Following the same code on Jeremy's blog).

My code here is as follows:

refLists = (List<Reference>)HostObjectUtils.GetTopFaces(roof);
                    foreach (Reference reference in refLists)
                    {
                        trans.Start();
                        var planFace = roof.GetGeometryObjectFromReference(reference) as PlanarFace;
                        planarFaceList.Add(planFace);
                        sketchplanesList.Add(SketchPlane.Create(doc, reference));
                     }

When I test this code against a manually drawn roof it works fine, but when I test it against the API drawn roof it doesn't respond, I also find the References are increased in number by 1 giving me 1 extra face that is not a planar face hence the error... I can't find a logical explanation so far!

0 Likes
358 Views
0 Replies
Replies (0)