Place Solid along the path

I am trying to place Road barriers along a path (polyline). The solid is converted from Microstation smart solid to GC readable solid. I have set-up a coordinate system at the start of my polyline. How can I array my solid (barrier) along the path? (Please note that my path is not planer, please check attached photo).

Things I want to achieve are,

1. Array Solid along the path.

2. Maintain min. 10mm spacing between each solid.

3. Output solids should follow the path vertically and horizontally.

4. If above mention things can be achieved then what are the steps (eg. do I have to setup point nodes, or coordinate system or planes along the path, any other things that I have to do to achieve my goal)

Thanks in Advance,

Jaimin Patel

  • Hi Jaimin,

    Yes, for B-spline geometry the algorithm would change. The example script was in response to your request about placing objects along a polyline. To cover both cases, one would have to modify the algorithm.

    In the example script the long objects are long compared to the path so that it becomes obvious if the would-be last object cannot be placed because its end point would not fall onto the path. Starting the start of placement could easily affect the last object to drop off, which in the long objects' case would be very apparent. With longer paths and shorter objects this remainder becomes less obvious. Again, depending on the requirements of the design, this could be adjusted in the script. With fixed object length and fixed spacing, controlling the number of objects could only be a limit of objects placed but not extend object placement past the end of the path to meet the number of object.

    The object clash situation is not trivial with a curvature potentially in three dimensions. Most likely this can be done.

    It is, however, a geometric and algorithmic problem, not a problem of mastery of C#. The required C# knowledge could be taught in a few hours (a start is for example the Zero to Simple Scripting sequence of GC SIGs). For a speedy algorithm, most likely some shortcuts are necessary like including the spacing as part of the object's size which would result in some perhaps tolerable inaccuracies.

    Regards,

        Volker

       

  • While placing the cell, I tried to use B-spline Curve, but the script didn't work. looks like this function is written to work with polyline only. Also, When I placed the solid cell along the path, it didn't place for the full length of the polyline, when I tried to change offset from start, the number of units was also changing. I know there must be a way that we can specify the limits (number of units or length of polyline on which the array will happen) scripts but it is very hard for me at this stage.

    In addition, as you mentioned earlier, for sharp curves there will be an issue of clashing which certainly can be eliminated by taking this script at another level. That is where I like GC, there is no limit, you can modify things according to your needs. The only problem is, you have to be master in C# Disappointed

  • Hi Jaimin,

    it is very useful and it almost what I wanted. It solved the problem 99% apart from a little issue

    What is the little issue (the 1%) that is missing?

    Best regards,

           Volker

       

  • Hi Mueller,

    Thanks for developing the script, it is very useful and it almost what I wanted. It solved the problem 99% apart from a little issue. I understand that it is developed for a particular case and It can't serve all the scenarios. However, the algorithm behind the script is very powerful. I wish I could reach this level of script writing. I know with the knowledge I have I could never fulfill my task. Thanks for helping out.

    I wish this type of functions are directly added in GC where users have to provide inputs (eg. spacing, path, reference cell/solid etc.) and software will do the rest of the job. There is a Microstation add-on available in Australia developed by Adam Lambert called CADDPRO, which is a very powerful tool it has many functions for placement especially for Super-T beams for the bridge which is very popular in Australia. I have added few snapshots of the tools for reference.

    For the case we were discussing, CADDPro can do the same job with very user-friendly tools, but as it is for Microstation, It can't do parametrically. However, I would say, it is very user-friendly. I hope to see a function like this added straight to GC so one can use it in many different kinds of scenarios.

    This was just a suggestion, or else, you are doing a great job by helping the users, you have a very powerful brain Slight smile I wish I could reach even near to you in scripting, that is why I want to leave scripting to GC team and have something very user-friendly which we can use day to day basis by using very less brain ;)

    Regards,

    Jaimin Patel

    (Snapshots from CADDPro below)

  • Hi Jaimin,

    Attached is an example script for placing a CoordinateSystem along a PolyLine based on some object's length and desired spacing between neighboring objects. The objects are assumed as placed in their own DGN model and can be placed as Cells. One end of the object should be on 0, 0, 0, which is the placement point, and its length should align with the X-axis of the DGN model.

    Instead of using a sphere as I initially suggested, I am using an Arc, for which I find the Plane through the Arc's center and the PolyLine's segment with which I want the Arc to intersect. If the Arc and the PolyLine segment don't intersect, the function proceeds to the next segment, etc. I hope I added sufficient commentary in the function.

    This function is the result of iterative development, running up against omissions in my logic, debugging unexpected results (one of them an infinite loop), etc. Please consider this when encountering some frustrations: that's par for the course.

    To reuse the script for your own purposes you'd need to redirect the reference attachment to the Line String or PolyLine on which you want to place the objects and resize the two points spanning the Range node accordingly. Similarly, the CellName and LibraryName input properties on cell1 would need to be updated, as well as the object length input to coordinateSystem1.ByFunction. Toward the end of the script I added a Slider node which uses the ByValueList technique to allow switching between a short and a long cell, and an Expression node that changes the length value accordingly, which becomes an input to coordinateSystem1. This keeps cell and length values aligned and could come handy in similar situations.

    This script works along the alignment. With wider objects in tighter curves an issue may arise that the placed objects might overlap. Checking to avoid that type of situation, or to enforce spacing between the closest points of adjacent objects requires additional work and significantly more knowledge about the placed objects' geometry (in addition to their length).

    HTH,

       Volker

    PlacementAlongAlignment.dgn

       

    Answer Verified By: Jaimin Patel