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
Thanks, Mueller.
Appreciate your effort.
I managed to generate points on the path by manually picking the reference point and sphere (converted to the surface). Then as you mentioned I created a coordinate system at the reference point by defining primary and secondary directions. In which Primary direction will next placement point and Secondary direction will be Z direction of baseCS as I want to place my object vertically.
Now the only problem is to clean this script and put some rules and conditions so that the whole process can be automated with minimum steps. I am sure you will be able to help in that, I have never done any node by function so it will be a good tutorial on real example about how to write a function.
Thanks,
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
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 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,
(Snapshots from CADDPro below)
Jaimin Patel said: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,
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# .