Stair Run Offset

Stair Run Offset

cheahjunyao1998
Participant Participant
423 Views
2 Replies
Message 1 of 3

Stair Run Offset

cheahjunyao1998
Participant
Participant

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();

0 Likes
424 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

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
0 Likes
Message 3 of 3

cheahjunyao1998
Participant
Participant

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

0 Likes