Usual Grid in Generative Components

Hello everybody,
I'm trying to create a simple axis grid. It should consist of X-directed and Y-directed axis lines and you should be able to set the number of axes and the distances between them by number-sliders.
My first thought was:
1. lines on the X and Y axis
2. points on these lines to determine distances and number of axes (e.g. length 10 m, number of points 5 --> points every 2 m)
3. axis grid lines: Starting points are the points on the axes (X direction, if point on Y axis and vice versa)
It seems quite complicated to me and I can imagine that there is an easier way. Does anyone know?
Best regards, Heiko

Parents
  • Thinking about this for a while I would prefer using an Excel sheet for the definition of the grid distances.

    This allows different grid spacing (as frequently happening) on both axes without hassle.

  • Hey Ingo,

    thank you for your help. 

    I think your model Looks very nice and I like the Connection to Excel, that you created. Can you tell me how I can connect the Excel Sheet to Model?

    Heiko

  • for the intersection - that's quite straightforward:

    transaction 5 modelChange 'Add point3'
    {
        node User.Objects.point3 Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'AtIntersection';
            Intersector0              = gridX;
            Intersector1              = gridY;
            GraphLocation             = <auto> {1410.0, 40.0};
            Replication               = ReplicationOption.AllCombinations;
        }
    }

    The rest I don't quite get - the last point of a list is point1[x] with x equal the highest instance.

    Or point1[0] for the first. Maybe that helps.

    Ingo

  • again i found the answer. I should stop asking before really trying Smiley

    It was a subject of replication style of the lists, of course

  • ok you were quicker. ;-)

    Maybe just toggle off replication / or delete in the code.

    But this might cause unwanted results when you have uneqal grid numbers.....

  • might get a bit tricky if you have unequal grid numbers......

  • The intersection worked quite well. 

    Here is my Transaction Log:

    transaction 1 modelChange 'Add baseCS, LengthGridX, NumberGridLinesX, NumberGridLinesY, WidthGridY'
    {
        node User.Objects.baseCS Bentley.GC.NodeTypes.CoordinateSystem
        {
            Technique                 = 'AtModelOrigin';
            DGNModelName              = 'Design Model';
            SymbolSize                = 1;
            GraphLocation             = <auto> {40.0, 40.0};
        }
        node User.Objects.NumberGridLinesX Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Resolution                = 1.0;
            GraphLocation             = {282.735, 57.225};
        }
        node User.Objects.NumberGridLinesY Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Resolution                = 1.0;
            GraphLocation             = {278.143, 221.099};
        }
        node User.Objects.LengthGridX Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 18.0;
            Maximum                   = 18.0;
            Resolution                = 0.1;
            GraphLocation             = {278.143, 384.972};
        }
        node User.Objects.WidthGridY Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 18.0;
            Maximum                   = 18.0;
            Resolution                = 0.1;
            GraphLocation             = {275.655, 548.846};
        }
    }
    transaction 2 modelChange 'Add LengthTotalX, LineTotalX, LineTotalY, PointsStartX, PointsStartY, WidthTotalY; change NumberGridLinesX, NumberGridLinesY'
    {
        node User.Objects.NumberGridLinesX Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 4.0;
        }
        node User.Objects.NumberGridLinesY Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 3.0;
        }
        node User.Objects.WidthTotalY Bentley.GC.NodeTypes.Expression
        {
            Technique                 = 'Default';
            Value                     = NumberGridLinesY*WidthGridY;
            GraphLocation             = {561.596, 395.81};
        }
        node User.Objects.LineTotalY Bentley.GC.NodeTypes.Line
        {
            Technique                 = 'ByStartPointDirectionLength';
            StartPoint                = baseCS;
            Direction                 = baseCS.YDirection;
            Length                    = WidthTotalY;
            GraphLocation             = {836.312, 401.231, 0.0, 142.443};
        }
        node User.Objects.LengthTotalX Bentley.GC.NodeTypes.Expression
        {
            Technique                 = 'Default';
            Value                     = NumberGridLinesX*LengthGridX;
            GraphLocation             = {563.036, 248.93};
        }
        node User.Objects.LineTotalX Bentley.GC.NodeTypes.Line
        {
            Technique                 = 'ByStartPointDirectionLength';
            StartPoint                = baseCS;
            Direction                 = baseCS.XDirection;
            Length                    = LengthTotalX;
            GraphLocation             = {840.908, 214.949, 174.0, 0.0};
        }
        node User.Objects.PointsStartY Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'BySpacingAlongCurve';
            Curve                     = LineTotalY;
            Spacing                   = WidthGridY;
            IncludeEnd                = true;
            GraphLocation             = {1126.416, 421.999};
        }
        node User.Objects.PointsStartX Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'BySpacingAlongCurve';
            Curve                     = LineTotalX;
            Spacing                   = LengthGridX;
            IncludeEnd                = true;
            GraphLocation             = {1130.416, 255.999};
        }
    }
    transaction 3 modelChange 'Add LinesGridX, LinesGridY; change LengthTotalX, LineTotalX, LineTotalY, PointsStartX, PointsStartY, WidthTotalY'
    {
        node User.Objects.WidthTotalY Bentley.GC.NodeTypes.Expression
        {
            GraphLocation             = {509.756, 414.53};
        }
        node User.Objects.LineTotalY Bentley.GC.NodeTypes.Line
        {
            GraphLocation             = {731.803, 421.137, 0.0, 142.443};
        }
        node User.Objects.LengthTotalX Bentley.GC.NodeTypes.Expression
        {
            GraphLocation             = {511.196, 267.65, 174.0, 0.0};
        }
        node User.Objects.LineTotalX Bentley.GC.NodeTypes.Line
        {
            GraphLocation             = {736.399, 234.856, 174.0, 0.0};
        }
        node User.Objects.PointsStartY Bentley.GC.NodeTypes.Point
        {
            GraphLocation             = {962.187, 421.999};
        }
        node User.Objects.PointsStartX Bentley.GC.NodeTypes.Point
        {
            GraphLocation             = {966.187, 255.999};
        }
        node User.Objects.LinesGridY Bentley.GC.NodeTypes.Line
        {
            Technique                 = 'ByStartPointDirectionLength';
            StartPoint                = PointsStartX;
            Direction                 = baseCS.YDirection;
            Length                    = NumberGridLinesY*WidthGridY;
            GraphLocation             = {1182.94, 384.053};
        }
        node User.Objects.LinesGridX Bentley.GC.NodeTypes.Line
        {
            Technique                 = 'ByStartPointDirectionLength';
            StartPoint                = PointsStartY;
            Direction                 = baseCS.XDirection;
            Length                    = LengthGridX*NumberGridLinesX;
            GraphLocation             = {1182.94, 224.053, 0.0, 142.443};
        }
    }
    transaction 4 modelChange 'Add PointsIntersection; change NumberGridLinesX, NumberGridLinesY'
    {
        node User.Objects.NumberGridLinesX Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 6.0;
        }
        node User.Objects.NumberGridLinesY Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 8.0;
        }
        node User.Objects.PointsIntersection Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'AtIntersection';
            Intersector0              = LinesGridX;
            Intersector1              = LinesGridY;
            Replication               = ReplicationOption.AllCombinations;
            GraphLocation             = {1602.91, -43.54};
        }
    }
    transaction 5 modelChange 'Change NumberGridLinesX, NumberGridLinesY, PointsIntersection'
    {
        node User.Objects.NumberGridLinesX Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 4.0;
        }
        node User.Objects.NumberGridLinesY Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 2.0;
        }
        node User.Objects.PointsIntersection Bentley.GC.NodeTypes.Point
        {
            GraphLocation             = {1401.356, 242.617, 0.0, 129.017};
        }
    }
    transaction 6 modelChange 'Change PointsIntersection'
    {
        node User.Objects.PointsIntersection Bentley.GC.NodeTypes.Point
        {
            GraphLocation             = {1478.494, -247.582, 0.0, 129.017};
        }
    }
    Thanks, my Problem is solved now. Slight smile
Reply
  • The intersection worked quite well. 

    Here is my Transaction Log:

    transaction 1 modelChange 'Add baseCS, LengthGridX, NumberGridLinesX, NumberGridLinesY, WidthGridY'
    {
        node User.Objects.baseCS Bentley.GC.NodeTypes.CoordinateSystem
        {
            Technique                 = 'AtModelOrigin';
            DGNModelName              = 'Design Model';
            SymbolSize                = 1;
            GraphLocation             = <auto> {40.0, 40.0};
        }
        node User.Objects.NumberGridLinesX Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Resolution                = 1.0;
            GraphLocation             = {282.735, 57.225};
        }
        node User.Objects.NumberGridLinesY Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Resolution                = 1.0;
            GraphLocation             = {278.143, 221.099};
        }
        node User.Objects.LengthGridX Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 18.0;
            Maximum                   = 18.0;
            Resolution                = 0.1;
            GraphLocation             = {278.143, 384.972};
        }
        node User.Objects.WidthGridY Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 18.0;
            Maximum                   = 18.0;
            Resolution                = 0.1;
            GraphLocation             = {275.655, 548.846};
        }
    }
    transaction 2 modelChange 'Add LengthTotalX, LineTotalX, LineTotalY, PointsStartX, PointsStartY, WidthTotalY; change NumberGridLinesX, NumberGridLinesY'
    {
        node User.Objects.NumberGridLinesX Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 4.0;
        }
        node User.Objects.NumberGridLinesY Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 3.0;
        }
        node User.Objects.WidthTotalY Bentley.GC.NodeTypes.Expression
        {
            Technique                 = 'Default';
            Value                     = NumberGridLinesY*WidthGridY;
            GraphLocation             = {561.596, 395.81};
        }
        node User.Objects.LineTotalY Bentley.GC.NodeTypes.Line
        {
            Technique                 = 'ByStartPointDirectionLength';
            StartPoint                = baseCS;
            Direction                 = baseCS.YDirection;
            Length                    = WidthTotalY;
            GraphLocation             = {836.312, 401.231, 0.0, 142.443};
        }
        node User.Objects.LengthTotalX Bentley.GC.NodeTypes.Expression
        {
            Technique                 = 'Default';
            Value                     = NumberGridLinesX*LengthGridX;
            GraphLocation             = {563.036, 248.93};
        }
        node User.Objects.LineTotalX Bentley.GC.NodeTypes.Line
        {
            Technique                 = 'ByStartPointDirectionLength';
            StartPoint                = baseCS;
            Direction                 = baseCS.XDirection;
            Length                    = LengthTotalX;
            GraphLocation             = {840.908, 214.949, 174.0, 0.0};
        }
        node User.Objects.PointsStartY Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'BySpacingAlongCurve';
            Curve                     = LineTotalY;
            Spacing                   = WidthGridY;
            IncludeEnd                = true;
            GraphLocation             = {1126.416, 421.999};
        }
        node User.Objects.PointsStartX Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'BySpacingAlongCurve';
            Curve                     = LineTotalX;
            Spacing                   = LengthGridX;
            IncludeEnd                = true;
            GraphLocation             = {1130.416, 255.999};
        }
    }
    transaction 3 modelChange 'Add LinesGridX, LinesGridY; change LengthTotalX, LineTotalX, LineTotalY, PointsStartX, PointsStartY, WidthTotalY'
    {
        node User.Objects.WidthTotalY Bentley.GC.NodeTypes.Expression
        {
            GraphLocation             = {509.756, 414.53};
        }
        node User.Objects.LineTotalY Bentley.GC.NodeTypes.Line
        {
            GraphLocation             = {731.803, 421.137, 0.0, 142.443};
        }
        node User.Objects.LengthTotalX Bentley.GC.NodeTypes.Expression
        {
            GraphLocation             = {511.196, 267.65, 174.0, 0.0};
        }
        node User.Objects.LineTotalX Bentley.GC.NodeTypes.Line
        {
            GraphLocation             = {736.399, 234.856, 174.0, 0.0};
        }
        node User.Objects.PointsStartY Bentley.GC.NodeTypes.Point
        {
            GraphLocation             = {962.187, 421.999};
        }
        node User.Objects.PointsStartX Bentley.GC.NodeTypes.Point
        {
            GraphLocation             = {966.187, 255.999};
        }
        node User.Objects.LinesGridY Bentley.GC.NodeTypes.Line
        {
            Technique                 = 'ByStartPointDirectionLength';
            StartPoint                = PointsStartX;
            Direction                 = baseCS.YDirection;
            Length                    = NumberGridLinesY*WidthGridY;
            GraphLocation             = {1182.94, 384.053};
        }
        node User.Objects.LinesGridX Bentley.GC.NodeTypes.Line
        {
            Technique                 = 'ByStartPointDirectionLength';
            StartPoint                = PointsStartY;
            Direction                 = baseCS.XDirection;
            Length                    = LengthGridX*NumberGridLinesX;
            GraphLocation             = {1182.94, 224.053, 0.0, 142.443};
        }
    }
    transaction 4 modelChange 'Add PointsIntersection; change NumberGridLinesX, NumberGridLinesY'
    {
        node User.Objects.NumberGridLinesX Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 6.0;
        }
        node User.Objects.NumberGridLinesY Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 8.0;
        }
        node User.Objects.PointsIntersection Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'AtIntersection';
            Intersector0              = LinesGridX;
            Intersector1              = LinesGridY;
            Replication               = ReplicationOption.AllCombinations;
            GraphLocation             = {1602.91, -43.54};
        }
    }
    transaction 5 modelChange 'Change NumberGridLinesX, NumberGridLinesY, PointsIntersection'
    {
        node User.Objects.NumberGridLinesX Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 4.0;
        }
        node User.Objects.NumberGridLinesY Bentley.GC.NodeTypes.Slider
        {
            Technique                 = 'Default';
            Value                     = 2.0;
        }
        node User.Objects.PointsIntersection Bentley.GC.NodeTypes.Point
        {
            GraphLocation             = {1401.356, 242.617, 0.0, 129.017};
        }
    }
    transaction 6 modelChange 'Change PointsIntersection'
    {
        node User.Objects.PointsIntersection Bentley.GC.NodeTypes.Point
        {
            GraphLocation             = {1478.494, -247.582, 0.0, 129.017};
        }
    }
    Thanks, my Problem is solved now. Slight smile
Children
No Data