Skip to content

Commit

Permalink
Added some comments for future reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
kike-garbo committed Jul 5, 2023
1 parent 7e9ee5e commit c2a42f1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/RhinoInside.Revit.GH/Components/Component.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,9 @@ public override void CollectData()
{
base.CollectData();

const double DesignLimits = 52_800.0; // feet.
var LengthLimit = GeometryDecoder.ToModelLength(DesignLimits);
// What is the distance limit from internal origin point for imported geometry in Revit?
// https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Revit-20-mile-origin-limit-for-imported-and-model-geometry.html
var DesignLimits = GeometryDecoder.ToModelLength(52_800.0 /* ft */);

foreach (var input in Params.Input.Where(x => x is IGH_BakeAwareObject))
{
Expand All @@ -429,13 +430,13 @@ public override void CollectData()
if (branch[i] is IGH_GeometricGoo goo)
{
var bbox = goo.Boundingbox;
if (bbox.Min.DistanceTo(Point3d.Origin) > LengthLimit || bbox.Max.DistanceTo(Point3d.Origin) > LengthLimit)
if (bbox.Min.DistanceTo(Point3d.Origin) > DesignLimits || bbox.Max.DistanceTo(Point3d.Origin) > DesignLimits)
{
if (!reported) AddRuntimeMessage
(
GH_RuntimeMessageLevel.Warning,
$"The input {input.NickName} lies outside of Revit design limits." +
$" Design limits are ±{GeometryDecoder.ToModelLength(DesignLimits):N0} {GH_Format.RhinoUnitSymbol()} around the origin.",
$" Design limits are ±{DesignLimits:N0} {GH_Format.RhinoUnitSymbol()} around the origin.",
GH_Convert.ToGeometryBase(goo)
);
}
Expand Down

0 comments on commit c2a42f1

Please sign in to comment.