Jump to content

replacing polyline with 3d polyline getting elevation(z)from reading other polyline


motee-z

Recommended Posts

hello friends

can any one help to draw 3dpolyline with enterval(x) getting elevation (z value)

from(y value of 2d polyline minus y value of datum value)

please see attached drawing for illustration

the aim of routine to get elevation directly from 3dployline in plan instead of going back to profile and measur chainage then elevation

thanks

Drawing2.dwg

Link to comment
Share on other sites

  • Replies 24
  • Created
  • Last Reply

Top Posters In This Topic

  • motee-z

    12

  • pBe

    11

  • BIGAL

    2

You need pick pline1 pick pline2 create pline 3 I dont have a coded answer but basicly you need to work with the two plines stepping and increment along them at same time get x1,y1 and x2,y2=Z after datum scale adjust then make a list x1,y1,z for new pline. Theres lots of posts here about stepping along a pline and pulling co-ords out just need to duplicate inside routine to run for each pline.

Link to comment
Share on other sites

I think this is will be very interesting routin for a wide number of engineers

and no one try to write a routin about it waiting for response

thanks

Link to comment
Share on other sites

I think this is will be very interesting routin for a wide number of engineers

and no one try to write a routin about it waiting for response

thanks

 

Its only been a few days motee-z, be patient :)

Link to comment
Share on other sites

The wide number of engineers would use something like CIV3d which can do this as you would use a surface and a pline draped on the surface.

 

Again as a start search for "export co-ords of a pline" and "chainages along a pline". Theres more need for a excel long & cross section routine and this could do also what you want.

Link to comment
Share on other sites

thanks to BIGAl and PBe to response i know civil3d not do like that draping polyline to surface from plan to plan not from profile to alignment

Link to comment
Share on other sites

_GetZelev re-write

Remove creation of temporary lines for intersect

(defun c:3DChainage (/ _GetZelev datum interval v1 chnProfile Alignment int v ptlist lst 3dpoints sp key scl)
 (vl-load-com)
;;;  3dpoly from Profile & Alignment	;;;
;;;       pBe Mar2013 V.1.2		;;;
 (defun _GetZelev (en1 in d v [b][color="red"]l[/color][/b] / mn mx dist tmpht i HtList pts)
   (setq [b][color="red"]sp (car l)
   	   mn    (list (apply 'min (mapcar 'car l)) (apply 'min (mapcar 'cadr l)))
         mx    (list (apply 'max (mapcar 'car l)) (apply 'max (mapcar 'cadr l)))[/color][/b]
         dist  (- (car mx) (car mn))
         tmpht (- (cadr mx) (cadr mn))
         i     in
   )
   (while (< i dist)
     (setq p1 (polar mn 0 i)
           p2 (polar p1 (/ pi 2.0) tmpht)
     )
     [color="red"][b](setq p3p4 (vl-some '(lambda (x y)
                            (if (<= (car x) (car p1) (car y))
                              (list x y)
                            )
                          )
                         l
                         (cdr l)
                )
     )[/b][/color]
     (setq HtList (append HtList (list (inters p1 p2 (car p3p4) (cadr p3p4))))
           i      (+ i in)
     )
     [b][color="red"](setq l (member (car p3p4) l))[/color][/b]
   )
   (setq pts (mapcar (function (lambda (j) (+ d v (- (cadr j) (cadr sp)))))
                     (append HtList (list (last l)))
             )
   )
   (cons (+ d v) pts)
 )
 (cond ((and (setq datum (getint "\nEnter Datum Value: "))
             (setq interval (getdist "\nEnter Interval Distance: "))
            [b][color="red"] (setq scl (getreal "\nEnter Vertical/Horizental Ratio: "))[/color][/b]
             (setq ptlist nil
                   v1     (getdist "\nEnter Start V1 Value: ")
             )
             (setq v1 (/ v1 scl))
             (setq chnProfile (car (entsel "\nSelect Chainage Profile: ")))
             (setq Alignment (car (entsel "\nSelect Alignment: ")))
             (setq int interval)
             (while (setq v (vlax-curve-getPointAtDist Alignment int))
               (setq ptlist (append ptlist (list v))
                     int    (+ int interval)
               )
             )
             (setq ptlist (cons (vlax-curve-getStartPoint Alignment)
                                (append ptlist (list (vlax-curve-getEndPoint Alignment)))
                          )
             )
             [b][color="red"](setq sp  (vlax-curve-getStartPoint chnProfile)
                   key (Cadr sp)
                   lst (cons sp
                             (mapcar '(lambda (j) (list (car j) (+ key (/ (- (cadr j) key) scl))))
                                     (cdr (mapcar 'cdr (vl-remove-if-not '(lambda (ent) (= (car ent) 10)) (entget chnProfile)))
                                     )
                             )
                       )
             )[/color][/b]
             (setq 3dpoints (mapcar (function (lambda (j k) (list (car j) (cadr j) k)))
                                    ptlist
                                    (_GetZelev (vlax-ename->vla-object chnProfile) interval datum v1 [b][color="red"]lst[/color][/b])
                            )
             )
             (progn (command "_spline") (foreach pt 3dpoints (command "_non" pt)) (command "" "" ""))
        )
       )
 )
 (princ)
)

 

command: 3DChainage

Enter Datum Value: 20

Enter Interval Distance: 5

Enter Vertical/Horizental Ratio: 10

Enter Start V1 Value: 66.055

Select Chainage Profile:

Select Alignment:

 

Edited by pBe
Vertical/Horizontal Ratio
Link to comment
Share on other sites

thank very much king pBe for the code it works fine

thanks again

 

Wow... tell me thats a typo motee-z :lol:

 

You are very welcome

 

Note: The routine doesnt include any default values nor error trapping , i believe you have enough experience with lisp codes to include those on your own

 

Cheers

Link to comment
Share on other sites

mr:pBe can you change 3dpolyine to spline

i tried to do like this but no result

(command "__spline")
                        (foreach
                               pt
                                 3dpoints
                              (command "_non" pt))
                        "")

spline drawn but i have to press enter three times

any suggestion

Edited by SLW210
Add Code Tags
Link to comment
Share on other sites

  • 9 months later...

sorry pBe for late question

can you please add variable (vertical/horizontal)ratio means all distances for every point of profle to datum line to multiply by ratio

thanks

Link to comment
Share on other sites

sorry pBe for late question

can you please add variable (vertical/horizontal)ratio means all distances for every point of profle to datum line to multiply by ratio

thanks

 

I dont know what that means motee-z, Like before you need to show what you need via sample drawing. chainage is all greek to me. :)

Link to comment
Share on other sites

check line pBe of your code

(setq v1 (getdist "\nEnter Start V1 Value: "))
if the vaue v1 not real distance

but it represent (v1/scal)

so all other points on profile must be same

the add to code must look like this

 

(setq scal(getreal"\n enter Vertical/Horizental Ratio"))
(setq v1 (getdist "\nEnter Start V1 Value: "))
(setq v1(/ v1 scal))

)

here first point will be okay but others will be not okay because must divided on scal

wish i am clear

thanks

Link to comment
Share on other sites

....here first point will be okay but others will be not okay because must divided on scal

wish i am clear

thanks

 

Once again motee-z, Post an example like the one attached at post # 9. it needs to show the desired result at a given value of v1 "divided on scal"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...