+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17
  1. #1
    Forum Deity StykFacE's Avatar
    Computer Details
    StykFacE's Computer Details
    Operating System:
    Windows Vista x64bit Business
    Computer:
    HP xw4600 Workstation
    CPU:
    Core2 Duo E8400 3.0GHz
    RAM:
    8GB DDR2-800
    Graphics:
    nVidia Quadro FX1700 512MB
    Stotage:
    250GB SATA
    Monitor:
    Dual Acer 19" LCD
    Using
    MEP 2010
    Join Date
    Mar 2006
    Location
    Dallas, TX - USA
    Posts
    3,919

    Default Looking for LISP for PLINE

    Registered forum members do not see this ad.

    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.
    Attached Images
    Tannar Frampton | Venture Mechanical - Dallas, TX
    Engineering/Construction department | AutoCAD MEP 2010 / Revit MEP 2010

  2. #2
    Super Member fixo's Avatar
    Computer Details
    fixo's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    E7500
    CPU:
    Intel(R)Core(TM)2 DUO CPU 2.93HGz
    RAM:
    4098 Gb
    Graphics:
    1024 Gb
    Using
    AutoCAD 2010
    Join Date
    Jul 2005
    Location
    Pietari, Venäjä
    Posts
    1,113

    Default

    Quote Originally Posted by StykFacE View Post
    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

    Code:
    (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 8))
          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 8))
          )
    
    (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 8))
          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 8))
          )
    
    (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 8))
      (command "._pline" "_non" p1u "_non" p1r "")
    
      (command "._pline" "_non" p2u "_non" p2r "")
    
      (setq points (cdr points))
      )
    (princ)
      )
    ~'J'~
    The soul is healed by being with children. - Fyodor Dostoyevsky, novelist (1821-1881)

  3. #3
    Forum Deity StykFacE's Avatar
    Computer Details
    StykFacE's Computer Details
    Operating System:
    Windows Vista x64bit Business
    Computer:
    HP xw4600 Workstation
    CPU:
    Core2 Duo E8400 3.0GHz
    RAM:
    8GB DDR2-800
    Graphics:
    nVidia Quadro FX1700 512MB
    Stotage:
    250GB SATA
    Monitor:
    Dual Acer 19" LCD
    Using
    MEP 2010
    Join Date
    Mar 2006
    Location
    Dallas, TX - USA
    Posts
    3,919

    Default

    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
    Tannar Frampton | Venture Mechanical - Dallas, TX
    Engineering/Construction department | AutoCAD MEP 2010 / Revit MEP 2010

  4. #4
    Super Member fixo's Avatar
    Computer Details
    fixo's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    E7500
    CPU:
    Intel(R)Core(TM)2 DUO CPU 2.93HGz
    RAM:
    4098 Gb
    Graphics:
    1024 Gb
    Using
    AutoCAD 2010
    Join Date
    Jul 2005
    Location
    Pietari, Venäjä
    Posts
    1,113

    Default

    Quote Originally Posted by StykFacE View Post
    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'~
    The soul is healed by being with children. - Fyodor Dostoyevsky, novelist (1821-1881)

  5. #5
    Forum Deity StykFacE's Avatar
    Computer Details
    StykFacE's Computer Details
    Operating System:
    Windows Vista x64bit Business
    Computer:
    HP xw4600 Workstation
    CPU:
    Core2 Duo E8400 3.0GHz
    RAM:
    8GB DDR2-800
    Graphics:
    nVidia Quadro FX1700 512MB
    Stotage:
    250GB SATA
    Monitor:
    Dual Acer 19" LCD
    Using
    MEP 2010
    Join Date
    Mar 2006
    Location
    Dallas, TX - USA
    Posts
    3,919

    Default

    Quote Originally Posted by fixo View Post
    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.
    Tannar Frampton | Venture Mechanical - Dallas, TX
    Engineering/Construction department | AutoCAD MEP 2010 / Revit MEP 2010

  6. #6
    Super Member fixo's Avatar
    Computer Details
    fixo's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    E7500
    CPU:
    Intel(R)Core(TM)2 DUO CPU 2.93HGz
    RAM:
    4098 Gb
    Graphics:
    1024 Gb
    Using
    AutoCAD 2010
    Join Date
    Jul 2005
    Location
    Pietari, Venäjä
    Posts
    1,113

    Default

    Quote Originally Posted by StykFacE View Post
    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'~
    The soul is healed by being with children. - Fyodor Dostoyevsky, novelist (1821-1881)

  7. #7
    Senior Member stevesfr's Avatar
    Computer Details
    stevesfr's Computer Details
    Operating System:
    Vista <ugh>
    Computer:
    HP Pavilion
    Monitor:
    Dell Trinitron
    Using
    AutoCAD 2008
    Join Date
    Jan 2009
    Location
    Central Illinois, USA
    Posts
    148

    Default

    Quote Originally Posted by fixo View Post
    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


  8. #8
    Super Member fixo's Avatar
    Computer Details
    fixo's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    E7500
    CPU:
    Intel(R)Core(TM)2 DUO CPU 2.93HGz
    RAM:
    4098 Gb
    Graphics:
    1024 Gb
    Using
    AutoCAD 2010
    Join Date
    Jul 2005
    Location
    Pietari, Venäjä
    Posts
    1,113

    Default

    Quote Originally Posted by stevesfr View Post
    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'~
    The soul is healed by being with children. - Fyodor Dostoyevsky, novelist (1821-1881)

  9. #9
    Super Member fixo's Avatar
    Computer Details
    fixo's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    E7500
    CPU:
    Intel(R)Core(TM)2 DUO CPU 2.93HGz
    RAM:
    4098 Gb
    Graphics:
    1024 Gb
    Using
    AutoCAD 2010
    Join Date
    Jul 2005
    Location
    Pietari, Venäjä
    Posts
    1,113

    Default

    Quote Originally Posted by stevesfr View Post
    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'~
    Attached Files
    The soul is healed by being with children. - Fyodor Dostoyevsky, novelist (1821-1881)

  10. #10
    Senior Member stevesfr's Avatar
    Computer Details
    stevesfr's Computer Details
    Operating System:
    Vista <ugh>
    Computer:
    HP Pavilion
    Monitor:
    Dell Trinitron
    Using
    AutoCAD 2008
    Join Date
    Jan 2009
    Location
    Central Illinois, USA
    Posts
    148

    Default

    Quote Originally Posted by fixo View Post
    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]
    <1>: _E
    Command:

Similar Threads

  1. Lisp to add & total every line/pline on a layer??
    By StykFacE in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 14th Nov 2009, 12:24 am
  2. lisp to put text with pline leangth above line
    By chelsea1307 in forum AutoLISP, Visual LISP & DCL
    Replies: 28
    Last Post: 2nd Jun 2009, 02:48 pm
  3. LISP to join many lines to a single 3D Pline
    By Phiphi in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 5th Feb 2009, 03:07 am
  4. Need a code lisp sum the length of line, pline, arc..
    By Nad SK in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 4th Dec 2008, 07:53 am
  5. continuous pline lisp
    By cadamrao in forum AutoCAD General
    Replies: 1
    Last Post: 21st Jan 2008, 09:51 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts