Lee Mac Posted September 22, 2009 Posted September 22, 2009 LoLI wish I had 1/10th the free time you have. Nice work Lee. Thanks Alan I won't have this much free time for long ... I'm off to uni in a week or so Quote
alanjt Posted September 22, 2009 Posted September 22, 2009 Thanks Alan I won't have this much free time for long ... I'm off to uni in a week or so Right on. Man, Europe is way behind America. We've been back for 3 weeks. Quote
Lee Mac Posted September 22, 2009 Posted September 22, 2009 Right on.Man, Europe is way behind America. We've been back for 3 weeks. Ahh, different uni's, different times.. some of the Uni's here have already started, but break up earlier too. Quote
alanjt Posted September 22, 2009 Posted September 22, 2009 Ahh, different uni's, different times.. some of the Uni's here have already started, but break up ealier too. True. My wife starts back teaching at the local community college a week before I go back to the university. Sucks for spring break. Quote
Lee Mac Posted September 22, 2009 Posted September 22, 2009 True. My wife starts back teaching at the local community college a week before I go back to the university. Sucks for spring break. You go to university? I didn't realise that - are you a lecturer or student? Quote
alanjt Posted September 22, 2009 Posted September 22, 2009 You go to university? I didn't realise that - are you a lecturer or student? Student, had to take a little break after the baby was born. Quote
Lee Mac Posted September 22, 2009 Posted September 22, 2009 Student, had to take a little break after the baby was born. Cool, what you studying mate? ('scuse the noseyness) Quote
alanjt Posted September 22, 2009 Posted September 22, 2009 Cool, what you studying mate? ('scuse the noseyness) Civil Engineering Ask all you like. Quote
Lee Mac Posted September 22, 2009 Posted September 22, 2009 Civil EngineeringAsk all you like. Sounds good mate - good luck with it. Quote
alanjt Posted September 22, 2009 Posted September 22, 2009 Sounds good mate - good luck with it. You too. Quote
Sam Pawar Posted July 13, 2010 Posted July 13, 2010 Hi Lee! Thanks for this lisp! I found it to work great on 2D polylines, but I am struggling on 3D polylines to get the new line in centre on plan view and to give it a z value. Can you please try it on my drawing and see if you get the same error as I did? What I thought it should be able to do is to draw a polyline in centre of two polylines in plan (xy) view and given the middle z value of the two 3D polylines? Please also see the attached snapshot for an illustration of my problem. It shows the two 3D polylines in yellow and the one created by your lisp in green. Regards, Sam test.dwg Quote
Lee Mac Posted July 13, 2010 Posted July 13, 2010 I recently updated that program for 3D here: http://www.cadtutor.net/forum/showpost.php?p=336800&postcount=5 Quote
Lee Mac Posted July 13, 2010 Posted July 13, 2010 Thanks! You're amazing at this:D You're welcome Sam Quote
squowse Posted May 20, 2011 Posted May 20, 2011 Hi, thanks for this routine to draw the centreline between 2 polylines. It is perfect for what I want - fixing a whiteline between 2 vehicle swept paths. I saw you also wrote a routine here http://www.cadtutor.net/forum/showthread.php?31521-Lisp-routine-for-the-widths-of-perpendicular-lines& to measure the distance between 2 polylines at intervals but only for polylines with two vertices. You are very industrious. My request (if you had time) would be for the routine that generates the centre line to be adapted to place an aligned dimension at intervals between 2 polylines. I might try myself but it will be like taking a chainsaw to a fine cabinet - stand back!! thanks roger Quote
rkmcswain Posted June 8, 2015 Posted June 8, 2015 loli wish i had 1/10th the free time you have. ^^^^^^^^^^^^ this ^^^^^^^^^^^^^^^^^ Quote
alanjt Posted June 8, 2015 Posted June 8, 2015 ^^^^^^^^^^^^ this ^^^^^^^^^^^^^^^^^ lol ...................... Quote
thejraj2k Posted July 14, 2016 Posted July 14, 2016 Try this dude: (defun c:cPoly (/ ent1 ent2 i len pt p1 ptlst) (vl-load-com) (if (and (setq ent1 (car (entsel "\nSelect First Polyline: "))) (wcmatch (cdr (assoc 0 (entget ent1))) "*POLYLINE")) (if (and (setq ent2 (car (entsel "\nSelect Second Polyline: "))) (wcmatch (cdr (assoc 0 (entget ent2))) "*POLYLINE")) (progn (setq i -1 len (/ (vla-get-Length (vlax-ename->vla-object ent1)) 100.)) (while (setq pt (vlax-curve-getPointatDist ent1 (* (setq i (1+ i)) len))) (setq p1 (vlax-curve-getClosestPointto ent2 pt t) ptlst (cons (polar pt (angle pt p1) (/ (distance pt p1) 2.)) ptlst))) (setq ptlst (apply 'append (mapcar (function (lambda (x) (list (car x) (cadr x)))) ptlst))) (vla-AddLightWeightPolyline (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-VBDouble (cons 0 (1- (length ptlst)))) ptlst)))))) (princ)) Dear Friend, same way instead of Selecting Polyline, if we select Line Entity, It has to draw straight polyline, with the requiered width ( i.e Gap between these 2 lines), it will be helpful for me. please develop this Lisp for me. Quote
63alfred Posted October 31, 2017 Posted October 31, 2017 Wonderfully simple code. I am trying to do something similar but need a little help. I am looking at interpolating intermediate elevation profile lines. Specifically I have 5 ft elevation profile lines and I need to interpolate so that I can get 1 ft profiles. I was able to expand your code above as noted below, but this entails having to pick the outside polylines 4 times instead of one. I am not experienced enough at LISP code to figure out how to have all the intermediate lines generated by simply clicking the outside polylines once. Thought someone might be able to give me some suggestions. Thanks (defun c:cPoly (/ ent1 ent2 i len pt p1 ptlst) (vl-load-com) (if (and (setq ent1 (car (entsel "\nSelect First Polyline: "))) (wcmatch (cdr (assoc 0 (entget ent1))) "*POLYLINE")) (if (and (setq ent2 (car (entsel "\nSelect Second Polyline: "))) (wcmatch (cdr (assoc 0 (entget ent2))) "*POLYLINE")) (progn (setq i -1 len (/ (vla-get-Length (vlax-ename->vla-object ent1)) 100.)) (while (setq pt (vlax-curve-getPointatDist ent1 (* (setq i (1+ i)) len))) (setq p1 (vlax-curve-getClosestPointto ent2 pt t) ptlst (cons (polar pt (angle pt p1) (* (distance pt p1) 0.2.)) ptlst))) (setq ptlst (apply 'append (mapcar (function (lambda (x) (list (car x) (cadr x)))) ptlst))) (vla-AddLightWeightPolyline (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-VBDouble (cons 0 (1- (length ptlst)))) ptlst)))))) (progn (setq i -1 len (/ (vla-get-Length (vlax-ename->vla-object ent1)) 100.)) (while (setq pt (vlax-curve-getPointatDist ent1 (* (setq i (1+ i)) len))) (setq p1 (vlax-curve-getClosestPointto ent2 pt t) ptlst (cons (polar pt (angle pt p1) (* (distance pt p1) 0.4.)) ptlst))) (setq ptlst (apply 'append (mapcar (function (lambda (x) (list (car x) (cadr x)))) ptlst))) (vla-AddLightWeightPolyline (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-VBDouble (cons 0 (1- (length ptlst)))) ptlst)))))) (progn (setq i -1 len (/ (vla-get-Length (vlax-ename->vla-object ent1)) 100.)) (while (setq pt (vlax-curve-getPointatDist ent1 (* (setq i (1+ i)) len))) (setq p1 (vlax-curve-getClosestPointto ent2 pt t) ptlst (cons (polar pt (angle pt p1) (* (distance pt p1) 0.6.)) ptlst))) (setq ptlst (apply 'append (mapcar (function (lambda (x) (list (car x) (cadr x)))) ptlst))) (vla-AddLightWeightPolyline (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-VBDouble (cons 0 (1- (length ptlst)))) ptlst)))))) (progn (setq i -1 len (/ (vla-get-Length (vlax-ename->vla-object ent1)) 100.)) (while (setq pt (vlax-curve-getPointatDist ent1 (* (setq i (1+ i)) len))) (setq p1 (vlax-curve-getClosestPointto ent2 pt t) ptlst (cons (polar pt (angle pt p1) (* (distance pt p1) 0.8.)) ptlst))) (setq ptlst (apply 'append (mapcar (function (lambda (x) (list (car x) (cadr x)))) ptlst))) (vla-AddLightWeightPolyline (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-VBDouble (cons 0 (1- (length ptlst)))) ptlst)))))) (princ)) Quote
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.