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 All,
My apologies, today and tomorrow morning I am focusing on preparing the GC SIG tomorrow. I'll then work through an example script because what you describe is a recurring challenge.
I was working from (sort of first) principles when describing the algorithm, that's why I chose a sphere for testing for the end point. I might have put my finger on a gap in GC's capabilities and will follow up on my side of things on that.
Meanwhile, from any center point and a segment's start and end points I can construct a plane on which I can draw a circle or arc to find that intersection point for the end point of the placed cell. This requires to step through subsequent segments until I find an intersection. A sphere could have made this easier. Good that you found the B-spline surface work around. Filtering the intersection points may be another challenge for which there certainly is some solution, like distances from start and end points of the segment on which one would expect the intersection point. I'll look into that tomorrow afternoon.
Transforming the steps from transactions to placing the cells using the ByFunction technique is the next step. One would most likely use a do-while or a while loop to iterate through the individual steps. Again, more about that tomorrow.
Regards,
Volker
Hi Emre,
Thanks for your response.
I followed instruction by Volker and somehow achieved this. (refer the image). I am able to generate things by nodes but still very hard writing the script. I could manually place sphear followed by the point at the intersection but I need to create a script which will do the job. Please note, I had to convert my spheresolid to BSplineSurface to get point at the intersection. Also, while creating a point at the intersection I am getting 2 points as the sphere will intersect on both directions on a curve (polyline). I will need to add the function which will ignore those points. I hope Volker will help us generate a proper script for this job. Especially in infrastructure (liner geometry), we use this function often to place objects like barriers, culverts, wall panels etc,. It will be very helpful if we can sort this out, then we can use the same script in future projects.
node User.Objects.solid3 Bentley.GC.NodeTypes.Solid { Technique = 'SphereByCentroidRadius'; Centroid = bsplineCurve1.StartPoint; Radius = 6; Density = 1; GraphLocation = {1212.256, 16.554}; } } { node User.Objects.solid3 Bentley.GC.NodeTypes.Solid { GraphLocation = {1199.056, 20.154}; } } { node User.Objects.bsplineSurface1 Bentley.GC.NodeTypes.BSplineSurface { Technique = 'ExtractAllSurfacesFromSolid'; SolidToExtractSurfacesFrom = solid3; GraphLocation = {1411.157, 20.57, 0.0, 115.59}; } node User.Objects.point1 Bentley.GC.NodeTypes.Point { Technique = 'AtIntersection'; Intersector0 = bsplineCurve1; Intersector1 = bsplineSurface1; IntersectionDirection = baseCS.YDirection; Replication = ReplicationOption.CorrespondingIndexing; GraphLocation = {1639.556, 5.756}; } }
Somehow my previous post removed. :/ Anyway...
Please check Karsten's videos as a starter if you didn't yet.
https://www.youtube.com/channel/UCSBc2Tuui0OH-r-clhGfi4w/videos
I hope Volker can show us how to find intersection point of sphere and curve/polyline/line with scripting or with any other amazing method.
But yes! I did try to achieve it with node structure few months back and you can find all details below.
transaction 1 modelChange 'Add baseCS, bsplineSurface3, coordinateSystem2, line1, line1_EndPoint, line1_StartPoint, point3, solid1, solid1_Centroid' { node User.Objects.baseCS Bentley.GC.NodeTypes.CoordinateSystem { Technique = 'AtModelOrigin'; DGNModelName = 'Design Model'; SymbolSize = 1; GraphLocation = {644.8, -677.12}; } node User.Objects.line1_StartPoint Bentley.GC.NodeTypes.Point { Technique = 'OnPlane'; Plane = baseCS.XYPlane; XTranslation = <free> 16850.1057076784; YTranslation = <free> 29365.4659236188; Color = 0; LevelName = 'Default'; LineStyleName = '0'; LineWeight = 0; GraphLocation = {934.006, -601.088, 0.0, 142.443}; } node User.Objects.line1_EndPoint Bentley.GC.NodeTypes.Point { Technique = 'OnPlane'; Plane = baseCS.XYPlane; XTranslation = <free> 139708.907498415; YTranslation = <free> 59216.8804251538; Color = 0; LevelName = 'Default'; LineStyleName = '0'; LineWeight = 0; GraphLocation = {925.062, -439.035, 172.576, 142.443}; } node User.Objects.line1 Bentley.GC.NodeTypes.Line { Technique = 'ByPoints'; StartPoint = line1_StartPoint; EndPoint = line1_EndPoint; Color = 0; LevelName = 'Default'; LineStyleName = '0'; LineWeight = 0; GraphLocation = {1165.248, -594.925}; } node User.Objects.solid1_Centroid Bentley.GC.NodeTypes.Point { Technique = 'OnPlane'; Plane = baseCS.XYPlane; XTranslation = <free> 40417.8011373495; YTranslation = <free> 35910.8159124388; Color = 0; LevelName = 'Default'; LineWeight = 0; GraphLocation = {931.984, -799.52, 0.0, 142.443}; } node User.Objects.solid1 Bentley.GC.NodeTypes.Solid { Technique = 'SphereByCentroidRadius'; Centroid = solid1_Centroid; Radius = 7900; Visibility = NodeVisibility.Visible; GraphLocation = {1154.086, -792.55, 0.0, 129.017}; } node User.Objects.bsplineSurface3 Bentley.GC.NodeTypes.BSplineSurface { Technique = 'SelectSurfaceFromSolid'; SolidToSelectSurfacesFrom = solid1; SelectorPoint = solid1.Centroid; Visibility = NodeVisibility.Hidden; GraphLocation = {1439.068, -797.787, 0.0, 129.017}; } node User.Objects.coordinateSystem2 Bentley.GC.NodeTypes.CoordinateSystem { Technique = 'AtCurveSurfaceIntersection'; Curve = line1; Surface = bsplineSurface3; Visibility = NodeVisibility.Visible; GraphLocation = {1793.279, -602.996}; } node User.Objects.point3 Bentley.GC.NodeTypes.Point { Technique = 'AtCurveSurfaceIntersection'; Curve = line1; Surface = bsplineSurface3; GraphLocation = {1783.148, -802.455, 0.0, 169.297}; } }
I got the theory of placement of an object.
I assume I will have to develop a script which will place the cell followed by following steps.
1. Find the origin of placement (which will be the start point of a line for example)
2. Construct a "sphear" around the "start point" by the radius which will intersect a point on the path. This point will be a reference point to construct the unambiguous coordinate system.
3. Place the cell along the coordinate system developed in Step 2.
4. Place a point by offset along the curve (for eg. 10mm). The reference point for offset will be the point generated by the sphear intersection (as mention in step 2).
5. Repeat step 1-4 by the number of cells along the path or distance along the path function.
Please correct me if I am going on the wrong track. If my assumptions are right then is there any example script that covers this steps. My apologies for asking too much help, I am very new to GC and trying my head around. I am now comfortable with using different nodes but can't develop a script.
If you could generate a full script, it will be very helpful for new users to understand scripts form real example and also for other people who want to achieve the same task. As you mention, it will be a standard script that can be used in any projects (by changing reference cell and polyline).
Any help will be appreciated.