measure distance between points in one direction / plane

Hi all,

Just wondering if there is a neat way to measure the distance between two points along a particular plane / direction? For example instead of measuring the 'true' distance between points; it would be useful to be able to calculate the measurement between them in just the x & y values rather than taking into account the z value.

I found the point node technique "ReportPointPositionInAnotherCoordinateSystem"  that does exactly what I am trying to achieve; reporting the xyz offset of a point in relation to the input coordinate system; however it does not seem to support multiple coordinate systems (corresponding to the list of points) which I require for the situation.

Thanks in advance,

Edward

Parents
  • Hi Edward,

    First thoughts are if you just wanted to ignore the Z value of a point you could just use an expression with something like {point1.X, point1.Y}. Which would return the x and y of that point.  This could then be a list of points etc..

    You could then use some maths to measure between points or generate temporary lines and measure the length. 

    Thanks

    Wayne

  • Hi Wayne,

    Thanks for the quick reply. I did actually end up going back to basics and using trig to resolve each axis; however it is not quite as elegant a solution as I hoped for when calculating relative to a set of custom coordinate systems, where the 'z' direction does not actually align with the baseCS.Zdirection. I had to implement a 'construction' point node to calculate the angle in order to resolve the distance in only the one axis.

    Sample code:

    transaction 10 modelChange 'Add constructionPt, Zoffset'
    {
        node User.Objects.constructionPt Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'ByCartesianCoordinates';
            CoordinateSystem    = EBtbmCS[0];
            XTranslation              = 0;
            YTranslation              = 0;
            ZTranslation              = 3.15;
            Visibility                     = NodeVisibility.Hidden;
            GraphLocation           = {1974.129, -283.129};
        }
        node User.Objects.Zoffset Bentley.GC.NodeTypes.Expression
        {
            Technique                 = 'Default';
            Value                         = (Distance(EBtbmCS[0],point3))*(Cos(Angle(EBtbmCS[0],constructionPt, point3)));
            GraphLocation          = {2229.009, -461.529};
        }
    }

    Perhaps this could be simplified further by utilising a Dpoint3d rather than creating an additional 'construction' point node? I couldn't figure out how to create this point based relative to the custom CS though, to simplify the operation to just a single expression node.

    Thanks,


    Ed

Reply
  • Hi Wayne,

    Thanks for the quick reply. I did actually end up going back to basics and using trig to resolve each axis; however it is not quite as elegant a solution as I hoped for when calculating relative to a set of custom coordinate systems, where the 'z' direction does not actually align with the baseCS.Zdirection. I had to implement a 'construction' point node to calculate the angle in order to resolve the distance in only the one axis.

    Sample code:

    transaction 10 modelChange 'Add constructionPt, Zoffset'
    {
        node User.Objects.constructionPt Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'ByCartesianCoordinates';
            CoordinateSystem    = EBtbmCS[0];
            XTranslation              = 0;
            YTranslation              = 0;
            ZTranslation              = 3.15;
            Visibility                     = NodeVisibility.Hidden;
            GraphLocation           = {1974.129, -283.129};
        }
        node User.Objects.Zoffset Bentley.GC.NodeTypes.Expression
        {
            Technique                 = 'Default';
            Value                         = (Distance(EBtbmCS[0],point3))*(Cos(Angle(EBtbmCS[0],constructionPt, point3)));
            GraphLocation          = {2229.009, -461.529};
        }
    }

    Perhaps this could be simplified further by utilising a Dpoint3d rather than creating an additional 'construction' point node? I couldn't figure out how to create this point based relative to the custom CS though, to simplify the operation to just a single expression node.

    Thanks,


    Ed

Children
No Data