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: 

Changing the slope parameter in Floors in Revit 2023

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
ahmadkhalaf7892
328 Views, 4 Replies

Changing the slope parameter in Floors in Revit 2023

1.PNG

2.PNG

  Hi Guys I wanted to ask how can I change the slope arrow in the floor From "Slope" to "height At Tail", if that is possible how can I edit the parameters "Height offset at tail" && "height offset at Head" . 
Keep in mind that the floor is alread created and I have the slopearrow also created . 
Floor floor = Floor.Create(doc, new List<CurveLoop> { c1 }, floortype.Id, lev.Id, true, Slopearrow, 0)

4 REPLIES 4
Message 2 of 5

I don't know whether this is possible programmatically, or how to achieve it in the UI either. One effective approach that you can take yourself to find out immediately is to perform the required modification manually in the end user interface and analyse the resulting API-accessible differences between the states before and after in the Revit database using RevitLookup and other database exploration tools:

  

https://thebuildingcoder.typepad.com/blog/2017/01/virtues-of-reproduction-research-mep-settings-onto...

  

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

Hi @jeremy_tammik , 
in the UI you just double click on the floor and select the slopearrow drawn inside the floor. I just want to change the Parameter Type "Slope" to "Height AT Tail" only and edit the parameters inside. are you sure there is no way to edit them ?
Thanks

 

Message 4 of 5

Hi @ahmadkhalaf7892 ,

 

Hi,

Yes, editing the slope arrow after creating a floor element is possible via Revit API.

First, you need to tell Revit whether you want to use "Height at Tail" or "Slope".For this you need to use BuiltInParameter.SPECIFY_SLOPE_OR_OFFSET

 

slopeArrow.get_Parameter(BuiltInParameter.SPECIFY_SLOPE_OR_OFFSET);
//"0" means height at tail
//"1" means slope

 

Here is the sample code for Height at tail

 

Floor floorElement;            
Sketch sketch=doc.GetElement(floorElement.SketchId) as Sketch;
IList<ElementId> allElements = sketch.GetAllElements();
foreach(ElementId eid in allElements)
    {                   
       Element e = doc.GetElement(eid);
       if(e.Name.Contains("Slope Arrow"))
       {
           double startValue;
           double endValue;
           e.get_Parameter(BuiltInParameter.SPECIFY_SLOPE_OR_OFFSET).Set(0);
        e.get_Parameter(BuiltInParameter.SLOPE_START_HEIGHT).Set(startValue);
        e.get_Parameter(BuiltInParameter.SLOPE_END_HEIGHT).Set(endValue);                       
       }
     }

 


Here is the sample code for slope

 

e.get_Parameter(BuiltInParameter.SPECIFY_SLOPE_OR_OFFSET).Set(1);
double slopeValue = 45 * (Math.PI / 180); //45 degree
e.get_Parameter(BuiltInParameter.ROOF_SLOPE).Set(slopeValue);

 

 


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

Message 5 of 5

Thank you very much Dear

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

Post to forums  

Forma Design Contest


Rail Community