Skip to content

Commit

Permalink
update section tool
Browse files Browse the repository at this point in the history
  • Loading branch information
GLOBAL\Giovanni.Brogiolo committed Apr 13, 2021
1 parent 8c4ae43 commit be0ea55
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
32 changes: 19 additions & 13 deletions ReviTab/Commands/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,20 +371,26 @@ public static void CreateSectionPerpendicular(Document doc, UIDocument uidoc, El
public static ViewSection CreateSectionParallel(Document doc, UIDocument uidoc, Element ele, double sectionPosition, double farClipOffset, double bottomLevel, double topLevel, string eleParameter, bool flipDirection)
{

Element wall = ele;

// Create a BoundingBoxXYZ instance centered on wall
BoundingBoxXYZ bb = wall.get_BoundingBox(null);
double minZ = bb.Min.Z;
double maxZ = bb.Max.Z;
double h = maxZ - minZ;
Level level = doc.ActiveView.GenLevel;
//double top = 90 - level.Elevation;
//double bottom = -(level.Elevation + 25);

LocationCurve lc = wall.Location as LocationCurve;
Line line = lc.Curve as Line;
Element lineBasedElement = ele;
Line line = null;

if (lineBasedElement.Category.Name != "Grids")
{
// Create a BoundingBoxXYZ instance centered on wall
BoundingBoxXYZ bb = lineBasedElement.get_BoundingBox(null);
double minZ = bb.Min.Z;
double maxZ = bb.Max.Z;
double h = maxZ - minZ;
Level level = doc.ActiveView.GenLevel;
LocationCurve lc = lineBasedElement.Location as LocationCurve;
line = lc.Curve as Line;
}
else
{
Grid grid = lineBasedElement as Grid;
line = grid.Curve as Line;
}

XYZ p = line.GetEndPoint(0);
XYZ q = line.GetEndPoint(1);
XYZ v = p - q; // p point 0 - q point 1 - view direction up.
Expand Down
10 changes: 5 additions & 5 deletions ReviTab/Forms/FormCreateSections.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit be0ea55

Please sign in to comment.