Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get The Area of a FamilyObject (Proof of Concept)

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Anonymous
344 Views, 1 Reply

Get The Area of a FamilyObject (Proof of Concept)

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.

1 REPLY 1
Message 2 of 2
naveen.kumar.t
in reply to: Anonymous

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report