tzframpton Posted November 20, 2009 Posted November 20, 2009 I think I've seen it before, but basically it's a LISP that creates the mitered 90° and 45° (well, any angle ° for that matter) Pipe symbol for single line plan view on a PLINE. Attached in the image shows an example, when you draw the PLINE it puts the corresponding symbol along the run at each angle run (highlighted in Yellow). Anyone know where I can find it? Once again, greatly appreciated to anyone who can lend a helping hand. Quote
fixo Posted November 21, 2009 Posted November 21, 2009 I think I've seen it before, but basically it's a LISP that creates the mitered 90° and 45° (well, any angle ° for that matter) Pipe symbol for single line plan view on a PLINE. Attached in the image shows an example, when you draw the PLINE it puts the corresponding symbol along the run at each angle run (highlighted in Yellow). Anyone know where I can find it? Once again, greatly appreciated to anyone who can lend a helping hand. Here is a quick and dirty simple lisp hope it will get you started C'mon would't to be lazy (defun C:demo(/ ang1 ang2 points elist endang tick p1 p1r p1u p2 p2r p2u p3 p4 pline pmid pt1 pt2 startang) (setvar 'osmode 0) (setvar 'cecolor "blue") (setvar 'plinewid 0) (command "._pline") (while (= 1 (logand 1 (getvar 'cmdactive))) (command pause)) (setq pline (entlast) points (vl-remove-if (function not) (mapcar (function (lambda (x) (if (= 10 (car x)) (cdr x)))) (setq elist (entget pline)) ) ) tick 25.4 ;<-- ticks length ) (setq startang (angle (car points) (cadr points)) endang (angle (nth (- (length points) 2) points) (last points)) ) (setq p1 (polar (car points) (+ startang (/ pi 2)) (/ tick 2)) pmid (mapcar (function (lambda (a b) (/ (+ a b) 2))) (car points) p1) p2 (polar pmid (+ startang pi) (/ tick ) p4 (polar (car points) (- startang (/ pi 2)) (/ tick 2)) pmid (mapcar (function (lambda (a b) (/ (+ a b) 2))) (car points) p4) p3 (polar pmid startang (/ tick ) ) (setvar 'cecolor "cyan") (command "_spline" p1 p2 p3 p4 "" p1 p4 "") (setq p1 (polar (last points) (+ endang (/ pi 2)) (/ tick 2)) pmid (mapcar (function (lambda (a b) (/ (+ a b) 2))) (last points) p1) p2 (polar pmid (+ endang pi) (/ tick ) p4 (polar (last points) (- endang (/ pi 2)) (/ tick 2)) pmid (mapcar (function (lambda (a b) (/ (+ a b) 2))) (last points) p4) p3 (polar pmid endang (/ tick ) ) (command "_spline" p1 p2 p3 p4 "" p1 p4 "") (setvar 'cecolor "yellow") (while (> (length points) 2) (setq ang1 (+ (angle (car points) (cadr points)) pi) ang2 (angle (cadr points) (caddr points)) pt1 (polar (cadr points) ang1 tick) p1u (polar pt1 (+ ang1 (/ pi 2)) (/ tick 2)) p1r (polar pt1 (- ang1 (/ pi 2)) (/ tick 2)) pt2 (polar (cadr points) ang2 tick) p2u (polar pt2 (+ ang2 (/ pi 2)) (/ tick 2)) p2r (polar pt2 (- ang2 (/ pi 2)) (/ tick 2)) ) (setvar 'plinewid (/ tick ) (command "._pline" "_non" p1u "_non" p1r "") (command "._pline" "_non" p2u "_non" p2r "") (setq points (cdr points)) ) (princ) ) ~'J'~ Quote
tzframpton Posted November 21, 2009 Author Posted November 21, 2009 Hmmm, this just might work. I downloaded it and already made a few adjustments for it to work exactly how I need... I just need to store the OSMODE and restore it when the command ends, then get an error handler in there. I won't touch the rest till Monday when I get back to work. Actually, let me work on this, and I'll post my finished code revisions when I'm done. This actually is a great learning opportunity for me.... thanks for the help. I think I can take this and finish it up. This is great learning for me too. I'll check back in Monday Quote
fixo Posted November 21, 2009 Posted November 21, 2009 Hmmm, this just might work. I downloaded it and already made a few adjustments for it to work exactly how I need... I just need to store the OSMODE and restore it when the command ends, then get an error handler in there. I won't touch the rest till Monday when I get back to work. Actually, let me work on this, and I'll post my finished code revisions when I'm done. This actually is a great learning opportunity for me.... thanks for the help. I think I can take this and finish it up. This is great learning for me too. I'll check back in Monday I would be happy to see your final product Cheers ~'J'~ Quote
tzframpton Posted November 21, 2009 Author Posted November 21, 2009 I would be happy to see your final product Cheers ~'J'~ Well, I can do a little "code monkeying" but I'm definitely no programmer. The best LISP routine I've ever made myself was about 6 lines, lol. Anyways, about to head out of town for the weekend, I'm sure when I'm back Monday I'll have some questions.... Thanks again. Quote
fixo Posted November 21, 2009 Posted November 21, 2009 Well, I can do a little "code monkeying" but I'm definitely no programmer. The best LISP routine I've ever made myself was about 6 lines, lol. Anyways, about to head out of town for the weekend, I'm sure when I'm back Monday I'll have some questions.... Thanks again. Allright, let me know what you need to change - I'll do it completely ~'J'~ Quote
stevesfr Posted November 21, 2009 Posted November 21, 2009 Allright, let me know what you need to change -I'll do it completely ~'J'~ Sorry to report, this is what I get.... Command: demo ._pline Specify start point: Current line-width is 0.0000 Specify next point or [Arc/Halfwidth/Length/Undo/Width]: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Command: ; error: bad argument type: 2D/3D point: nil blue lines, nothing else Quote
fixo Posted November 21, 2009 Posted November 21, 2009 Sorry to report, this is what I get.... Command: demo ._pline Specify start point: Current line-width is 0.0000 Specify next point or [Arc/Halfwidth/Length/Undo/Width]: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Command: ; error: bad argument type: 2D/3D point: nil blue lines, nothing else Thanks for the testing I can't change it right now, sorry Will be do it later ~'J'~ Quote
fixo Posted November 21, 2009 Posted November 21, 2009 Sorry to report, this is what I get.... Command: demo ._pline Specify start point: Current line-width is 0.0000 Specify next point or [Arc/Halfwidth/Length/Undo/Width]: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Command: ; error: bad argument type: 2D/3D point: nil blue lines, nothing else Try edited version ~'J'~ pipe.LSP 1 Quote
stevesfr Posted November 22, 2009 Posted November 22, 2009 Try edited version ~'J'~ sorry, something still a miss... nothing but blue lines again Command: pipe ._pline Specify start point: Current line-width is 0.0000 Specify next point or [Arc/Halfwidth/Length/Undo/Width]: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Command: bad argument type: 2D/3D point: nil._undo Current settings: Auto = On, Control = All, Combine = Yes Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] : _E Command: Quote
fixo Posted November 22, 2009 Posted November 22, 2009 sorry, something still a miss... nothing but blue lines again Oops, my bad You're right, thanks Try edited version Edit: I added missed double quotes at the end of code ~'J'~ pipe.LSP Quote
stevesfr Posted November 22, 2009 Posted November 22, 2009 Oops, my badYou're right, thanks Try edited version ~'J'~ now I get this when loading... Command: appload PIPE.lsp successfully loaded. Command: ; error: malformed string on input Command: Quote
Lee Mac Posted November 22, 2009 Posted November 22, 2009 Try this Steve, (defun C:pipe (/ *error* ang1 ang2 cec elist endang osm p1 p1r p1u p2 p2r p2u p3 p4 pline pmid points pt1 pt2 pwid startang tick) (defun *error* (msg) (if (vl-position msg '("console break" "Function cancelled" "quit / exit abort" ) ) (princ " >> Error occurs!") (princ msg) ) (command "._undo" "_E") (if osm (setvar "osmode" osm)) (if cec (setvar "cecolor" cec)) (if pwid (setvar "plinewid" pwid)) (setvar "cmdecho" 1) ) (command "._undo" "_BE") (setq osm (getvar "osmode")) (setvar "osmode" 0) (setq cec (getvar "cecolor")) (setvar "cecolor" "cyan") (setq pwid (getvar "plinewid")) (setvar "plinewid" 0) (setvar "cmdecho" 0) (command "._pline") (while (= 1 (logand 1 (getvar "cmdactive"))) (command pause)) (setq pline (entlast) points (vl-remove-if (function not) (mapcar (function (lambda (x) (if (= 10 (car x)) (cdr x)))) (setq elist (entget pline)) ) ) tick 2.5 ;<-- ticks length ) (command "._zoom" "_O" pline "") (setq startang (angle (car points) (cadr points)) endang (angle (nth (- (length points) 2) points) (last points)) ) (setq p1 (polar (car points) (+ startang (/ pi 2)) (/ tick 2)) pmid (mapcar (function (lambda (a b) (/ (+ a b) 2))) (car points) p1) p2 (polar pmid (+ startang pi) (/ tick ) p4 (polar (car points) (- startang (/ pi 2)) (/ tick 2)) pmid (mapcar (function (lambda (a b) (/ (+ a b) 2))) (car points) p4) p3 (polar pmid startang (/ tick ) ) (setvar "cecolor" "blue") (command "_spline" "_non" p1 "_non" p2 "_non" p3 "_non" p4 "" "" "") (setq p1 (polar (last points) (+ endang (/ pi 2)) (/ tick 2)) pmid (mapcar (function (lambda (a b) (/ (+ a b) 2))) (last points) p1) p2 (polar pmid (+ endang pi) (/ tick ) p4 (polar (last points) (- endang (/ pi 2)) (/ tick 2)) pmid (mapcar (function (lambda (a b) (/ (+ a b) 2))) (last points) p4) p3 (polar pmid endang (/ tick ) ) (command "_spline" "_non" p1 "_non" p2 "_non" p3 "_non" p4 "" "" "") (setvar "cecolor" "yellow") (while (> (length points) 2) (setq ang1 (+ (angle (car points) (cadr points)) pi) ang2 (angle (cadr points) (caddr points)) pt1 (polar (cadr points) ang1 tick) p1u (polar pt1 (+ ang1 (/ pi 2)) (/ tick 2)) p1r (polar pt1 (- ang1 (/ pi 2)) (/ tick 2)) pt2 (polar (cadr points) ang2 tick) p2u (polar pt2 (+ ang2 (/ pi 2)) (/ tick 2)) p2r (polar pt2 (- ang2 (/ pi 2)) (/ tick 2)) ) (setvar "plinewid" (/ tick ) (command "._pline" "_non" p1u "_non" p1r "") (command "._pline" "_non" p2u "_non" p2r "") (setq points (cdr points)) ) (*error* "") (princ) ) (princ "\n\t\t***\tType PIPE to execute\t***") (princ) Quote
fixo Posted November 22, 2009 Posted November 22, 2009 now I get this when loading... Command: appload PIPE.lsp successfully loaded. Command: ; error: malformed string on input Command: Sorry, Missed double quotes in command prompt at the end of code (I wrote it right here) (princ "\n\t\t***\tType PIPE to execute\t***") Try again, please ~'J'~ Quote
stevesfr Posted November 22, 2009 Posted November 22, 2009 Sorry,Missed double quotes in command prompt at the end of code (I wrote it right here) (princ "\n\t\t***\tType PIPE to execute\t***") Try again, please ~'J'~ sameo sameo, problem still there I've been looking through _sysvdlg to see if anything is amiss, I can't find where a setting has upset something in my Acad8, even reboot and start acad from scratch.. this is still the message ... Command: pipe ._undo Current settings: Auto = On, Control = All, Combine = Yes Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] : _BE ready to give up... thanks for trying, I'm stumped.. others having any problems with Acad8 ?? s Quote
Lee Mac Posted November 22, 2009 Posted November 22, 2009 sameo sameo, problem still thereI've been looking through _sysvdlg to see if anything is amiss, I can't find where a setting has upset something in my Acad8, even reboot and start acad from scratch.. this is still the message ... Command: pipe ._undo Current settings: Auto = On, Control = All, Combine = Yes Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] : _BE ready to give up... thanks for trying, I'm stumped.. others having any problems with Acad8 ?? s Yes, that's correct - did you try clicking on the screen at that point? Quote
stevesfr Posted November 23, 2009 Posted November 23, 2009 Yes, that's correct - did you try clicking on the screen at that point? Yep, starts the pline command and then when two or more lines are drawn, hitting enter produces a zoom extents, and thats it. Quote
Abdulellah Posted August 14, 2023 Posted August 14, 2023 Another modification please, for an existing polyline, the user enter the thickness and length of the dash , as well as the length of the cutting symbol , user can enteter distance from each vertics to insert , user can choose the location to insert cut symbole , either the beginning or the end of the polyline, or the beginning and the end together Quote
Abdulellah Posted August 14, 2023 Posted August 14, 2023 On 22/11/2009 at 00:09, fixo said: Try edited version ~'J'~ pipe.LSP 2.77 kB · 14 downloads Another modification please 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.