Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help Needed lisp Routine for Creating 3D Polylines with Specified Slope"

89 REPLIES 89
Reply
Message 1 of 90
libarraSCXGZ
4667 Views, 89 Replies

Help Needed lisp Routine for Creating 3D Polylines with Specified Slope"

Hi everyone,

I need to develop a LISP routine that allows creating a 3D polyline with a user-specified slope. The goal is for the user to select a starting point, and then the polyline should continue along the surface, following the slope until it reaches a point where the maximum slope at that point is less than the design slope.

I have to carry out feasibility studies for roads and irrigation canals, and it is tedious to do it manually.

Here is a reference of what I need to do:


https://filesnj.carlsonsw.com/mirror/manuals/Carlson_2007/online/index.html?page=source%2FSite_Road_...

 

Could you help me with some basic LISP code to help me study and move forward with this? My knowledge of LISP is basic, but any help would be appreciated.

89 REPLIES 89
Message 2 of 90
Sea-Haven
in reply to: libarraSCXGZ

You could pay for the Carlson solution, you will probably get much more as well. 

 

It may have been like 2 years ago or more this was asked for and some comments were made. 

 

Try googling. 

 

Hint Dotsoft, Red Transit consultants.

Message 3 of 90
libarraSCXGZ
in reply to: Sea-Haven

@Sea-Haven . Buying is obviously an option, but it's not the complete package that I need, I'm looking for help or guidance on this, I did the search on google and gpt chat, maybe since English is not my strong language the question was not the correct one. I hope to find help in the forum.
thanks for your comment.
Message 4 of 90
Kent1Cooper
in reply to: libarraSCXGZ

I'm a mere Architect, with insufficient understanding of Civil Engineering, which may be why I'm having a hard time understanding what you're asking.  For example, here:

Kent1Cooper_0-1722343107532.png

the blue arrowhead is the start point, and the lower green path is your supposedly 20%-slope route.  I drew the red paralleling it through a stretch that is essentially level, and then where my orange parallels it, the slope is suddenly and significantly steeper.  So that path varies enormously in slope just within itself.  What does 20% mean in that case?  Can you describe in greater detail how that route was arrived at, and what's really intended?

 

Also, are the contours in 3D, that is, does each have its own real elevation in the Z direction, or is it a flattened 2D representation?

Kent Cooper, AIA
Message 5 of 90
libarraSCXGZ
in reply to: Kent1Cooper

@Kent1Cooper 20% means that the layout goes down 20 m for every 100 m of progress through the layout. Thinking of a road or drainage channel. And if within a section the slope could vary greatly but always under 20% in this case or the percentage assigned to the routine.
The topographic base could be a 3D civil surface or a series of 2D polylines with elevation in Z or 3D polylines with elevation.
Message 6 of 90
Kent1Cooper
in reply to: libarraSCXGZ


@libarraSCXGZ wrote:
.... if within a section the slope could vary greatly but always under 20% in this case or the percentage assigned to the routin[g]. .....

Yes, I understand what 20% represents.  What I don't understand is how the routing that's labeled 20% was arrived at.  The one labeled 30% looks like it would also be well under 20% in the beginning.  [It's hard to say, not knowing what the contour interval is, nor the scale of the contour drawing.]  So, for example, why does the 20% path not take the same route as the 30% path at least near the start where it's apparently under 20%?  These are the kinds of considerations that make such a thing difficult to automate.  Specific criteria on which to base calculations are necessary.

Kent Cooper, AIA
Message 7 of 90
libarraSCXGZ
in reply to: Kent1Cooper

@ Kent1Cooper I understand your point of view and it is totally valid, it is clearly necessary to define criteria. The example on Carlson's page is just that, an example. Perhaps the routine only needs a minimum and maximum criterion. I didn't want to go into too much detail at this point, since the routine is complicated.
Thanks for your comments, they help to improve the context!
Message 8 of 90
john.uhden
in reply to: libarraSCXGZ

@libarraSCXGZ ,

It looks to me like you need to invest in Civil3D, where you can..

a)  Build an existing terrain model.

b)  Define a horizontal alignment.

c)  Have it create an existing profile.

d)  Create a proposed profile.

e)  Label all the slopes.

f)  And a whole lot more.

John F. Uhden

Message 9 of 90
Sea-Haven
in reply to: libarraSCXGZ

The Red Transit consultants was a Youtube showing how you take a surface TIN of 3dfaces, the emphasis is a TIN not contours, and work out the slope across the 3dface given a grade. The Youtube clearly showed how it crossed the TIN network. 

 

Trying to find it again. You need to wait for advertising to finish. 

 

Found it Civil 3D App - Grade Slope Along Surface (youtube.com)

Message 10 of 90
john.uhden
in reply to: Sea-Haven

Alan,

He may not know what a TIN is... Triangulated Irregular Network, aka a Digital Terrain Model (DTM).

John F. Uhden

Message 11 of 90
john.uhden
in reply to: Kent1Cooper

Baloney, @Kent1Cooper .

You know a lot about everything!

That's why we love you.

John F. Uhden

Message 12 of 90
Sea-Haven
in reply to: libarraSCXGZ

If want a range say 20% max and say 5% desirable would run twice so solution is in between the 2 plines and as @john.uhden has suggested draw an alignment with straights and curves.

Message 13 of 90
libarraSCXGZ
in reply to: john.uhden

Hi @john.uhden I've been using Civil 3D for years, and I always learn something new, especially from this forum. The issue is finding a quick way to evaluate projects in the initial stages without getting into too much detail.
For roads and channels extending over 1 km, it would also be a tool to complement the use of Civil 3D. Civil 3D does not have a feature to find the best route between two points.
I usually search for routes manually, using the old-school method of checking slopes, then generating my alignments and everything else. While this method is precise, it's definitely slower
Message 14 of 90
libarraSCXGZ
in reply to: Sea-Haven

@Sea-Haven That’s definitely the idea! Thanks for the link to the video.
Message 15 of 90
john.uhden
in reply to: libarraSCXGZ

@libarraSCXGZ ,

Well then you've got the tools already and they are certainly many times better than doing things by hand.
It's beyond most of us here in the AutoLisp forum to provide you a quick decision-making solution.  Autodesk no longer exposes methods and properties within C3D as they did for Land Desktop.  But you could try posting your question in the C3D Customization forum.

Always remember to budget for extra work.

John F. Uhden

Message 16 of 90
Sea-Haven
in reply to: libarraSCXGZ

When you look at the youtube it shows the path across the 3dfaces, I am sure question was asked before. CIV3D has function convert surface to 3dFaces.

 

 

 

Message 17 of 90

I am a retired Civil engineer and land surveyor.  Many years ago I wrote software to use in my business to create TIN's,  contour maps, plan profiles, earthwork volume calculations, and even an interface to connect a total station and draw directly into AutoCAD.  This was before Civil3D or even Land Development.  I have recently worked on importing LIDAR (LAS LAZ ) files and recently created a water drop (water flow across a TIN) routine. I found this discussion of creating a polyline with a given slope across the face of a TIN interesting, and was wondering if anyone had specific details on how it was done in the Carlson video?

Message 18 of 90

Hi, @autoid374ceb4990 I'm researching how to use the normal angle of the 3Dface to perform this task. It will be a long but entertaining road. I don't think I can work with 3D civil surfaces.
Message 19 of 90

libarraSCXGZ:

I think you are on the correct path with the face normals. Attached is a LISP file that may help you get started.  The file was sent to me by L. Minardi, a member of this forum.  The code is for finding the path of a water drop on the surface of a triangular 3DFACE.  Basically you select a 3DFACE, pick a point inside the 3DFACE, and the program calculates the intersect point of a water drop with one side of the the triangle.  It should work with triangular 3DFACEs if they follow the right hand rule.  I have no idea about the CIVIL 3d surfaces since I used my own TIN format.  Hope this helps.

Message 20 of 90
Sea-Haven
in reply to: libarraSCXGZ

Watch the you tube video will see desired method need to Watch to about 3/4 way through.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report