+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Forum Newbie
    Using
    Civil 3D 2015
    Join Date
    Jan 2016
    Posts
    2

    Default Storm Pipe Lisp Command

    Registered forum members do not see this ad.

    Hi,

    I was wondering if someone could help me out with the attached lisp file. My company likes to show the storm drain in our base with 4 different lines. One line for the centerline with a global width of zero with linetype continuous that would be on layer A, a polyline for the centerline with a global width of whatever size the pipe is with dashed2 linetype on layer B. The other two lines will offset half the distance of the pipe size from the centerline and will be continuous on layer B. The way the lisp currently works is it Converts selection set of Lines, Polylines, LWPolylines, and Arcs to sets of triple parallel polylines. Outer polylines have zero width and CONTINUOUS line type, while inner polyline uses Dashed2 linetype with user-selected width. I would like it for it does not change the original line i drew but instead copies and changes it to whatever my current layer is and offset it half the size of the pipe to both sides and than changes it to to a polyline with the global width of the pipe size and dashed2. I would appreciate any help.
    Attached Files

  2. #2
    Forum Newbie
    Using
    Civil 3D 2015
    Join Date
    Jan 2016
    Posts
    2

    Default

    To help clarify on what it looks like, I attached a PDF of it.
    Attached Files

  3. #3
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,902

    Default

    Registered forum members do not see this ad.

    it seems to work maybe something wrong in the linetype scaling, also linetype use this, you need to look at the sequence of events in your code before changing the line type make a copy of it and move it slightly away do the edits then move it back

    *EqualPipe,Equalpipe _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    A, 2.4, -2.4

    also this
    Code:
    ; pipe offset for different size pipes
    ; by Alan H July 2014
    
    (vl-load-com)
    (defun existLinetype (LineTypeName / item loaded)
      (setq  doc (vla-get-activedocument (vlax-get-acad-object))) ; open database
      (vlax-for item (vla-get-linetypes doc)
        (if (= (strcase (vla-get-name item)) (strcase LineTypeName))
          (setq loaded T)
        )  
      )
    
      (if (= Loaded T)
        (princ "loaded")
        (command "-linetype" "L" LineTypeName "P:\\AUTODESK\\SUPPORTFILES\\CUSTOM.LIN" "")
      )
    )
    (existLinetype "EX_PIPE250")
    
    (defun pipeoffset (w / ang stpt pt3 pt4 obj whatis)
    (setq oldsnap (getvar "osmode"))
    (setvar "osmode" 0)
    (setq obj (entsel "\nPick line"))
    (setq objtype (vla-get-objectname (vlax-ename->vla-object (car obj))))
    (if (= "AcDbLINE" objtype)
      (progn
         (alert "You have picked an object which is not a line\nTry Again")
         (exit)
      )
      (princ "\nLine")
    )
    (setq stpt (assoc 10 (entget (car obj))))
    (setq stpt (list (nth 1 stpt)(nth 2 stpt)))
    (setq endpt (assoc 11 (entget (car obj))))
    (setq endpt (list (nth 1 endpt)(nth 2 endpt)))
    (setq ang (angle stpt endpt))
    (setq pt3 (polar stpt (+ ang (/ pi 2.0)) 1.0))
    (setq pt4 (polar stpt (- ang (/ pi 2.0)) 1.0))
    (command "offset" w obj pt3 "")
    (Command "chprop" "last" "" "LT" "EX_PIPE250" "")
    (command "offset" w obj pt4 "")
    (Command "chprop" "last" "" "LT" "EX_PIPE250" "")
    (command "Erase" obj "")
    (setvar "osmode" oldsnap)
    )
    
    
    (defun c:P100 ()
    (pipeoffset 0.06)
    )
    (defun c:P150 ()
    (pipeoffset 0.08)
    )
    
    (defun c:P225 ()
    (pipeoffset 0.152)
    )
    
    (defun c:P300 ()
    (pipeoffset 0.19)
    )
    
    (defun c:P375 ()
    (pipeoffset 0.228)
    )
    
    (defun c:P450 ()
    (pipeoffset 0.265)
    )
    
    (defun c:P525 ()
    (pipeoffset 0.302)
    )
    
    (defun c:P600 ()
    (pipeoffset 0.34)
    )
    
    (defun c:P675 ()
    (pipeoffset 0.34)
    )
    
    (defun c:P750 ()
    (pipeoffset 0.415)
    )
    
    (defun c:P825 ()
    (pipeoffset 0.455)
    )
    
    (defun c:P900 ()
    (pipeoffset 0.49)
    )
    
    (defun c:P975 ()
    (pipeoffset 0.528)
    )
    
    (defun c:P1050 ()
    (pipeoffset 0.565)
    )
    
    (defun c:P1125 ()
    (pipeoffset 0.6)
    )
    
    (defun c:P1200 ()
    (pipeoffset 0.64)
    )
    
    (princ)
    A man who never made mistakes never made anything

Similar Threads

  1. Lisp for Pipe-cut
    By prashanthmsp in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 19th Mar 2013, 10:23 am
  2. Linetype for Storm Sewers?
    By chulse in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 16
    Last Post: 4th Mar 2008, 10:29 am
  3. Anyone use XP-Rafts or XP-Storm?
    By andrewjbarnett in forum Catch All
    Replies: 2
    Last Post: 20th Sep 2007, 08:27 am

Tags for this Thread

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