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)
Solved! Go to Solution.
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)
Solved! Go to Solution.
Solved by naveen.kumar.t. Go to Solution.
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:
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:
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
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
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);
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);
Thank you very much Dear
Thank you very much Dear
Hi, guys, I need something similar to pipe; I want to change the slope for a pipe. I'm using this code
// Get the pipe's parameter for slope
Parameter slopeParam = pipe.get_Parameter(BuiltInParameter.RBS_PIPE_SLOPE);
slopeParam.Set(0.01041667);
However, when executing the line slopeParam.Set(0.01041667) I get an error because slopeParam is readOnly, this operation Im doing when the user is drawing or updating a pipe, Have you any Idea how I can change the slope when is drawing?.
Thank you
Best regards
Hi, guys, I need something similar to pipe; I want to change the slope for a pipe. I'm using this code
// Get the pipe's parameter for slope
Parameter slopeParam = pipe.get_Parameter(BuiltInParameter.RBS_PIPE_SLOPE);
slopeParam.Set(0.01041667);
However, when executing the line slopeParam.Set(0.01041667) I get an error because slopeParam is readOnly, this operation Im doing when the user is drawing or updating a pipe, Have you any Idea how I can change the slope when is drawing?.
Thank you
Best regards
Moral: explore optimal workflows and best practices manually in the user interface first.
The API is mostly just a wrapper around UI functionality.
Afaict from the discussions above, the slope is a parameter of the system, not the individual element. That might explain why the element parameter is read-only.
Moral: explore optimal workflows and best practices manually in the user interface first.
The API is mostly just a wrapper around UI functionality.
Afaict from the discussions above, the slope is a parameter of the system, not the individual element. That might explain why the element parameter is read-only.
Can't find what you're looking for? Ask the community or share your knowledge.