Profile from 3D Polyline

Profile from 3D Polyline

Anonymous
Not applicable
1,767 Views
4 Replies
Message 1 of 5

Profile from 3D Polyline

Anonymous
Not applicable

Please help us this topic, I want to make the profile of the 3D polyline. Please see attached sample file.

0 Likes
1,768 Views
4 Replies
Replies (4)
Message 2 of 5

ВeekeeCZ
Consultant
Consultant

Try this quickly adjusted @Kent1Cooper's routine unfold.lsp. Thx Kent, hope you don't mind 🙂

I don't know what vertical scale do you use/want. So in the code there is the note, change it as you like. (we're using y=10*x scale) 

 

Spoiler
(vl-load-com)

(defun C:PL2Profile (/ pt3d->2d ss en pt1 pt2 dpts)

  (defun pt3d->2d (pt / ) (reverse (cons 0. (cdr (reverse pt)))))
  
  (prompt "\nRequired a SINGLE 3D Polyline,")
  (if (and (setq ss (ssget "_+.:E:S" '((0 . "POLYLINE"))))
	   (= 1 (sslength ss))
	   (setq en (ssname ss 0)))
    (progn
      (repeat (setq par (fix (vlax-curve-getEndParam en)))
	(setq pt1 (vlax-curve-getPointAtParam en par)
	      pt2 (vlax-curve-getPointAtPAram en (setq par (1- par)))
	      dpts (cons (list (distance (pt3d->2d pt1)
					 (pt3d->2d pt2))
			       (- (last pt2)
				  (last pt1)))
			 dpts)))
      (command "_.pline") (princ " ...for the profile: ") (command PAUSE)
      (repeat (length dpts)
	(command "_none" (polar (polar (getvar 'LASTPOINT)
				       0
				       (caar dpts))
				(* 0.5 pi)
				(* (cadar dpts) 10))) ; Evelation scale (profile's y)
	(setq dpts (cdr dpts)))
      (command "")))
)

 

 

Message 3 of 5

Anonymous
Not applicable

This works, but it has been flogged half to generate. The attachment Cprof.lsp made by PBAJSE. Thank you PBAJSE. The lisp to complete generate profiles. But some of these flaws, it is native to only straight line to block. It may be generated in the direction (along) of polyline is possible.

0 Likes
Message 4 of 5

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

This works, but it has been flogged half to generate. The attachment Cprof.lsp made by PBAJSE. Thank you PBAJSE. The lisp to complete generate profiles. But some of these flaws, it is native to only straight line to block. It may be generated in the direction (along) of polyline is possible.


Unfortunately I don't understand what you mean by "flogged half to generate". My routine works for me, see result on . I did not dig into it... just wondering, why these two routines gives different result.
PS. Somehow I can't run pBes routine (not digged more into)

0 Likes
Message 5 of 5

Anonymous
Not applicable

I mean to say is that the PL2Profile Lisp Generate only ground profile. Does not show the detail of elevation and chainage. And Cprof.lsp you will select all the blocks that have all the details is Generate. did you select the whole block.

Here is the reason for the difference in profile, cprof.lsp Lisp Generate the liner distance that is wrong.

0 Likes