TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Windsor on June 22, 2022, 07:50:09 AM

Title: Automatically create 3D Polylines on crossing 3D polyline Geometry??
Post by: Windsor on June 22, 2022, 07:50:09 AM
Hi there,

This is my first post here and I'm quite new to autolisp programming.

My problem is that I want to automatically generate a 3D Polyline across existing 3D Polylines (please see IMAGE 1 below). is this possible through Autolisp as this has been puzzling me for some time now. (Cyan line is ar z=0, yellow is 3D polyline crossing contours and grey are 3d contours comprised of 3D polylines)

I'm aware this process can be done manually using the apparent intersection objectsnap in plan view or by using civil 3D. However I am simply looking to speed up workflow as sections like these take up a lot of time when there are many of them to do and I don not have access to Civil 3D, only standart AutoCAD.

Any help with this would be greatly appreciated!

if there is any further information you need please let me know.
Title: Re: Automatically create 3D Polylines on crossing 3D polyline Geometry??
Post by: ribarm on June 22, 2022, 08:55:31 PM
I am not with CAD to test unnecessary tested things, but I can tell - if your contours are 3d polys and you need 3d poly spanning across like projection of reference polyline entity (lwpoly), then please try one of routines packed in this ZIP file :
https://www.theswamp.org/index.php?topic=9042.msg576276#msg576276

Good luck...
Title: Re: Automatically create 3D Polylines on crossing 3D polyline Geometry??
Post by: Windsor on June 23, 2022, 05:17:27 AM
Hi there, thanks for the reply.

I'm a bit stuck on how to use these as I wish to create the yellow lines in the image above. these .lsp files dont allow me to select any of the olyline geometry.

I must be missing something obvious but I'm new to using lisp programmes.

Regards,
Luke
Title: Re: Automatically create 3D Polylines on crossing 3D polyline Geometry??
Post by: BIGAL on June 23, 2022, 07:52:13 PM
This is a every day question for civil engineers, so simple answer is get Civil software add on.

Ok I here moaning but it costs.

So look at other products like TriangV0.6.7.lsp does what you want maybe as it uses TIN's yes its free.
Title: Re: Automatically create 3D Polylines on crossing 3D polyline Geometry??
Post by: Windsor on June 24, 2022, 03:30:16 AM
Hi Bigal

This has been a question that's been on my mind for a while now, unfortunately I only work through AutoCAD but the lisp that you have mentioned below is brilliant, it generates geometry comprising of 3d faces that can then be cut with a lifted line and the resulting spline can be converted into a polyline and be used for 2D sections. This is already a real timesaver.

Thank you very much for sending this on!
Title: Re: Automatically create 3D Polylines on crossing 3D polyline Geometry??
Post by: Lee Mac on June 25, 2022, 11:37:49 AM
The program I posted here (https://www.cadtutor.net/forum/topic/48610-level-lines-calculate-height/page/2/#comment-401910) back in 2013 is close to what you're looking for, though, this operates with 2D polyline contours rather than 3D polyline contours.
Title: Re: Automatically create 3D Polylines on crossing 3D polyline Geometry??
Post by: BIGAL on June 25, 2022, 08:45:48 PM
I dont know how much civil work you do but Civil Site Design will run with Autocad as is reasonably priced and does way more than you will probably ever use.


https://civilsitedesign.com
Title: Re: Automatically create 3D Polylines on crossing 3D polyline Geometry??
Post by: doaiena on June 27, 2022, 09:10:56 PM
I think i have an idea, but i dont have time to present it in code at the moment.

- select 3DPolylines
- select lines that you want to check for intersections with
- make flat copies of 3DPolylines (z = 0)

3DPoly - ((1 . 3DPoly1) (2 . 3DPoly2) (3 . 3DPoly3) etc...)
FlatCopy - ((1 . FlatPoly1) (2 . FlatPoly2) (3 . FlatPoly3) etc...)

- check for intersections between the flat copies and the lines

(setq intersectionPoint3D (vlax-curve-getPointAtParam 3DPoly1... (vlax-curve-getParamAtPoint FlatPoly1... intersectionPoint2D)))

- make a list of all intersection3D points and sort them from the start point of the line
- connect all intersection3D points
Title: Re: Automatically create 3D Polylines on crossing 3D polyline Geometry??
Post by: BIGAL on June 27, 2022, 10:10:01 PM
Also posted here https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-cutting-sections-with-lisp-routine/td-p/11248758

Suggested use TriangV.0.6.7.lsp that has extract long section from a TIN model and its free.
Title: Re: Automatically create 3D Polylines on crossing 3D polyline Geometry??
Post by: ribarm on June 28, 2022, 12:28:01 AM
Just for clearance, to put back topic on top...