Get The Area of a FamilyObject (Proof of Concept)

Anonymous

Get The Area of a FamilyObject (Proof of Concept)

Anonymous
Not applicable

Hello All!

 

I have made a custom method that executes after someone pulls the shape handles. I am wanting to simply calculate the area of the geometry of the item. I looked at a few examples of getting the geometry of a family instance which clued me in, however I am a bit unclear on how to actually grab specific information (such as getting back the width and height of an object).

 

Thanks in advance! This forum is seriously super helpful and has helped me learn alot about revit.

0 Likes
Reply
Accepted solutions (1)
344 Views
1 Reply
Reply (1)

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

HI @Anonymous,

 Element e;
Double s,s1,x;
                    foreach(Parameter P in e.Parameters)
                    {
                        if(P.Definition.Name.Contains("your desired height parameter name"))
                        {
                            s = P.AsDouble();
                        }
                        if(P.Definition.Name.Contains("Your desired width parameter name"))
                        {
                            s1 = P.AsDouble();
                        }
                        x = s * s1;
                    }

Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes