Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Drawing perpendicular to a 3D polyline

  1. #1
    Member
    Join Date
    2005-09
    Posts
    39
    Login to Give a bone
    0

    Cool Drawing perpendicular to a 3D polyline

    The problem I am having is drawing waterline services perpendicular to a 3D pipe run. Is there and easy way to do this without having to change my 3D polyline to a zero elevation? Lisps?

  2. #2
    I could stop if I wanted to
    Join Date
    2003-12
    Location
    Pittsburgh, PA
    Posts
    355
    Login to Give a bone
    0

    Default Re: Drawing perpendicular to a 3D polyline

    Try this... I tried it with a 3DPolyline and it seemed to work
    Code:
    ;;  PLPERP.lsp starts a polyline perpendicular to any 2D curve at
    ;;    the point picked.
    ;;  Allows direct distance entry for first polyline segment, then
    ;;    restores previous ortho setting and snap angle (if any).
    
    ;;  by Bill Gilliss  bill dot gilliss at aya.yale.edu
    ;;  3/20/2008
    ;;  Comments and suggestions always welcome.
    
    (defun c:plperp ( / e en obj param p1 p2 wp1 sa oldortho oldsnapang oldosmode olderror)
    
      (setq oldortho (getvar "orthomode") 
            oldsnapang (getvar "snapang")
            oldosmode (getvar "osmode")
            olderror *error*
            )
      (setq e (entsel "Select curve at point to start perpendicular (OSNAPS welcome):"))
      (setq en (car e) p1 (cadr e))            ;UCS point
      (setq p1 (osnap p1 "_nea"))
      (setq obj (vlax-ename->vla-object en))
      (setq param (vlax-curve-getParamAtPoint obj (trans p1 1 0)))  ;WCS point
      (setq fderiv (vlax-curve-getFirstDeriv obj param))
      (setq sa (+ (* pi 0.5) (angle (trans '(0.0 0.0 0.0) 0 1) (trans fderiv 0 1))))
      (setvar "snapang" sa)
      (setvar "orthomode" 1)
      (setq p2 (getpoint p1 "\nNext point:"))
      (setvar "orthomode" oldortho)
      (setvar "snapang" oldsnapang)
      (setvar "osmode" oldosmode)
      (setq *error* olderror)
      
    
      (command "pline" p1 p2)
    );defun
    
    
    (defun *error* (msg)
      (setvar "orthomode" oldortho)
      (setvar "snapang" oldsnapang)
      (setvar "osmode" oldosmode)
      (setq *error* olderror)
      ) 
    
    (prompt "PLPERP loaded.")
    (princ)

  3. #3
    Member
    Join Date
    2005-09
    Posts
    39
    Login to Give a bone
    0

    Default Re: Drawing perpendicular to a 3D polyline

    This lisp seems to be for a curve? I tried it but it's asking me: Select curve at point to start perpendicular (OSNAPS welcome):

  4. #4
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Drawing perpendicular to a 3D polyline

    You can start by drawing a (2d) polyline from a point (generally a vertex, sometimes a midpoint, etc) on the 3dpoly.
    The exact method will vary with circumstances - just remember that the entire 2d polyline will have the same z-value as the first point picked.
    Then you can draw one or more segments away from the target polyline and come back to it with a PERpendicular osnap.

  5. #5
    Member
    Join Date
    2005-09
    Posts
    39
    Login to Give a bone
    0

    Unhappy Re: Drawing perpendicular to a 3D polyline

    I was afraid of that! I was hoping someone had a short cut for me.

  6. #6
    Member
    Join Date
    2007-08
    Posts
    47
    Login to Give a bone
    0

    Default Re: Drawing perpendicular to a 3D polyline

    am I missing something?

    waterline service?

    start pline @ approx. water meter location, (osnap perpendicular), snap to 3d pipe line.

    you can leave pipe line 3d, and still snap a 2d pline perpendicular to it.

    hope this helps

  7. #7
    Member
    Join Date
    2005-09
    Posts
    39
    Login to Give a bone
    0

    Default Re: Drawing perpendicular to a 3D polyline

    Yes, it allows you to snap to a 3D polyline but it isn't perpendicular on the 2D plane. Try this draw a 3D polyline then make sure the verticies have about 10' or so difference in elevation (z) between them say 890 and 900, then draw a line and snap it perpindicular to the 3D polyline you have just drawn.

  8. #8
    Member
    Join Date
    2007-08
    Posts
    47
    Login to Give a bone
    0

    Default Re: Drawing perpendicular to a 3D polyline

    when I tested i yesterday my 3d polyline only had about 1' elev. drop.

    so the pline appeared to be perpendicluar, but when I increased elev. drop, not perpendicular. duh!

    just a thought, make temp layout and draw your services in paperspace, and snap to 3d pipe line in model, using a viewport.

    then when done, issue changespace to put services in model space @ 0 elev.

  9. #9
    I could stop if I wanted to
    Join Date
    2003-12
    Location
    Pittsburgh, PA
    Posts
    355
    Login to Give a bone
    0

    Default Re: Drawing perpendicular to a 3D polyline

    Quote Originally Posted by sbullinger View Post
    This lisp seems to be for a curve? I tried it but it's asking me: Select curve at point to start perpendicular (OSNAPS welcome):
    Ignore that it says Curve, try it on s 3DPolyline. I just tried it on a 3dpolyline w/ vertices @ 890 and 900, snapping to midpoint and it drew a pline perpendicular @ 895.

  10. #10
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Drawing perpendicular to a 3D polyline

    Would changing UCS to match the slope help?

Page 1 of 2 12 LastLast

Similar Threads

  1. Drawing Polyline
    By joel.mckeown680061 in forum Dot Net API
    Replies: 0
    Last Post: 2014-11-13, 05:04 PM
  2. 2013: DRAWING A POLYLINE THAT ATTACHES BLOCK AT POINTS
    By CIngalsb397420 in forum AutoCAD General
    Replies: 3
    Last Post: 2013-07-08, 01:09 PM
  3. Replies: 15
    Last Post: 2008-09-09, 01:19 PM
  4. Replies: 11
    Last Post: 2007-08-28, 10:25 PM
  5. Continue the program after drawing a Polyline
    By ruben.137692 in forum AutoLISP
    Replies: 2
    Last Post: 2007-04-15, 09:00 PM

Posting Permissions

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