motee-z Posted May 24, 2012 Share Posted May 24, 2012 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 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 25, 2012 Share Posted May 25, 2012 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. Quote Link to comment Share on other sites More sharing options...
pBe Posted May 25, 2012 Share Posted May 25, 2012 That is a tall order motee-z, but doable. Quote Link to comment Share on other sites More sharing options...
motee-z Posted May 25, 2012 Author Share Posted May 25, 2012 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 Quote Link to comment Share on other sites More sharing options...
pBe Posted May 26, 2012 Share Posted May 26, 2012 I think this is will be very interesting routin for a wide number of engineersand no one try to write a routin about it waiting for response thanks Its only been a few days motee-z, be patient Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 26, 2012 Share Posted May 26, 2012 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. Quote Link to comment Share on other sites More sharing options...
motee-z Posted May 26, 2012 Author Share Posted May 26, 2012 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 Quote Link to comment Share on other sites More sharing options...
pBe Posted May 29, 2012 Share Posted May 29, 2012 Do one manually and show us the result motee-z Quote Link to comment Share on other sites More sharing options...
motee-z Posted May 29, 2012 Author Share Posted May 29, 2012 here is an example test.dwg Quote Link to comment Share on other sites More sharing options...
pBe Posted June 3, 2012 Share Posted June 3, 2012 (edited) _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 March 15, 2013 by pBe Vertical/Horizontal Ratio Quote Link to comment Share on other sites More sharing options...
motee-z Posted June 3, 2012 Author Share Posted June 3, 2012 thank very much king pBe for the code it works fine thanks again Quote Link to comment Share on other sites More sharing options...
pBe Posted June 4, 2012 Share Posted June 4, 2012 thank very much king pBe for the code it works finethanks again Wow... tell me thats a typo motee-z 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 Quote Link to comment Share on other sites More sharing options...
motee-z Posted June 10, 2012 Author Share Posted June 10, 2012 (edited) 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 June 11, 2012 by SLW210 Add Code Tags Quote Link to comment Share on other sites More sharing options...
pBe Posted June 11, 2012 Share Posted June 11, 2012 (progn (command "_spline") (foreach pt 3dpoints (command "_non" pt)) (command "" "" "")) Quote Link to comment Share on other sites More sharing options...
motee-z Posted March 12, 2013 Author Share Posted March 12, 2013 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 Quote Link to comment Share on other sites More sharing options...
pBe Posted March 13, 2013 Share Posted March 13, 2013 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. Quote Link to comment Share on other sites More sharing options...
motee-z Posted March 13, 2013 Author Share Posted March 13, 2013 check line pBe of your code (setq v1 (getdist "\nEnter Start V1 Value: "))if the vaue v1 not real distancebut 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 Quote Link to comment Share on other sites More sharing options...
pBe Posted March 14, 2013 Share Posted March 14, 2013 ....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" Quote Link to comment Share on other sites More sharing options...
motee-z Posted March 14, 2013 Author Share Posted March 14, 2013 this sample dwg sample.dwg Quote Link to comment Share on other sites More sharing options...
pBe Posted March 14, 2013 Share Posted March 14, 2013 I will have a look-see and maybe post an updated code tomorrow motee-z Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.