Hello,
im a little new to C#, I was trying to look for a way where the Plug-In lets me select a top floor slab and then the bottom floor slab, so that I can subtract the parameters from both and get the height difference. The issue is I do not understand how to tell the code to let me select the second floor slab. Is there a link which describes something similar?
I have been successful in selecting the first floor slab and display the height of its bottom surface. To calculate the height difference I need to be able to select the bottom floor slab and get its top height, then I can subtract the two. But this seems to be a challenge. Any similar link or code, which does this?
Solved! Go to Solution.
Solved by naveen.kumar.t. Go to Solution.
Hi @d.ahmed.hb ,
Are you looking for this?
//Lets you to Select first floor
Reference r1 = uidoc.Selection.PickObject(ObjectType.Element);
Floor firstFloor = doc.GetElement(r1.ElementId) as Floor;
Parameter firstFloorParameter = firstFloor.get_Parameter() (or) firstFloor.LookupParameter("");
double firstFloorHeight = firstFloorParameter.AsDouble();
//Lets you to Select second floor
Reference r2 = uidoc.Selection.PickObject(ObjectType.Element);
Floor secondFloor = doc.GetElement(r2.ElementId) as Floor;
Parameter secondFloorParameter = secondFloor.get_Parameter() (or) secondFloor.LookupParameter("");
double secondFloorHeight = secondFloorParameter.AsDouble();
Can't find what you're looking for? Ask the community or share your knowledge.