Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

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: 

Stair Run Offset

2 REPLIES 2
Reply
Message 1 of 3
cheahjunyao1998
250 Views, 2 Replies

Stair Run Offset

Hello everyone. I am now experiencing a problem where the stair run is offset when the actual run width is not equal to 1000mm. Is there anyone who can identify the potential problem?

 

When the actual run width is 1000mm:

cheahjunyao1998_6-1660184168963.png

 

 

When the actual run width is 1500mm:

cheahjunyao1998_5-1660184133888.png

 

When the actual run width is 500mm:

cheahjunyao1998_0-1660266726759.png

 

Below is the codes to create the run:


Line locationLine = Line.CreateBound(new XYZ(startPoint.X, startPoint.Y, topLevel.Elevation), new XYZ(endPoint.X, endPoint.Y, topLevel.Elevation));
StairsRunJustification orientation = StairsRunJustification.Left;
if (staircase.Orientation == StaircaseOrientation.ToLeft)
{
orientation = StairsRunJustification.Right;
}
StairsRun newRun2 = StairsRun.CreateStraightRun(doc, newStairsId, locationLine, orientation);
newRun2.ActualRunWidth = ConverterHelper.MmToFoot(flight.Width);
newRun2.BeginsWithRiser = true;
newRun2.EndsWithRiser = false;
newRun2.BaseElevation = ConverterHelper.MmToFoot(staircase.Start.Z);
newRun2.TopElevation = ConverterHelper.MmToFoot(staircase.End.Z);
var runType = doc.GetElement(newRun2.GetTypeId()) as StairsRunType;
runType.StructuralDepth = ConverterHelper.MmToFoot(staircase.FlightElements[0].WaistThickness);

stair.get_Parameter(BuiltInParameter.ALL_MODEL_MARK).Set(staircase.Label);
stair.get_Parameter(BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS).Set(staircase.ID);
t.Commit();

2 REPLIES 2
Message 2 of 3

I cannot read your code. It would be easier to read as text, rather than an image. There is a button above the editor to Insert/Edit code sample.

  

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

Hi, I have changed the codes from image to text. Thanks in advance for you help.

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

Post to forums  

Autodesk Design & Make Report