public static Point3d GetStairInsertPoint(Solid3d stair3d) { GripDataCollection grips = new GripDataCollection(); GetGripPointsFlags bitFlags = GetGripPointsFlags.GripPointsOnly; stair3d.GetGripPoints(grips, 0, 0, Application.DocumentManager.MdiActiveDocument.Editor.GetCurrentView().ViewDirection, bitFlags); // Grip point [0] is the start point of the polyline defining the stair // Grip point [0,1,2] are the points defining the vertical line and grip point [2,3,4] defining the horizontal line of the first step Point3d pInsert = grips[0].GripPoint; grips.Dispose(); return(pInsert); }
public static Matrix3d GetStairDisplacment(Solid3d stair3d) { Editor ed = Application.DocumentManager.MdiActiveDocument.Editor; GripDataCollection grips = new GripDataCollection(); GetGripPointsFlags bitFlags = GetGripPointsFlags.GripPointsOnly; stair3d.GetGripPoints(grips, 0, 0, ed.GetCurrentView().ViewDirection, bitFlags); // Grip point [0] is the start point of the polyline defining the stair Vector3d disp = Point3d.Origin.GetVectorTo(grips[0].GripPoint); grips.Dispose(); return(Matrix3d.Displacement(disp)); }
public static double GetStairRotationAngle(Solid3d stair3d) { GripDataCollection grips = new GripDataCollection(); GetGripPointsFlags bitFlags = GetGripPointsFlags.GripPointsOnly; stair3d.GetGripPoints(grips, 0, 0, Application.DocumentManager.MdiActiveDocument.Editor.GetCurrentView().ViewDirection, bitFlags); // Grip point [0] is the start point of the polyline defining the stair // Grip point [0,1,2] are the points defining the vertical line and grip point [2,3,4] defining the horizontal line of the first step Point2d start = new Point2d(grips[2].GripPoint.X, grips[2].GripPoint.Y); Point2d end = new Point2d(grips[4].GripPoint.X, grips[4].GripPoint.Y); Point3d pInsert = grips[0].GripPoint; grips.Dispose(); return(start.GetVectorTo(end).Angle); }