Building footprint lisp ?

Discussion in 'AutoCAD' started by Miles, Nov 2, 2004.

  1. Miles

    Miles Guest

    All,
    We have been tasked to "digitize" building outlines from aerial photographs.
    The problem I am having is constantly drawing a starter line, setting a new
    UCS, type PLAN so that I can use my ORTHO to get
    perpend. corners. Over and over and over again.

    Is there a lisp that would allow me to draw the first line at any angle,
    then, all following lines are only allowed to be perpend. to the last ?

    We are using LDD3.
    Thanks.
     
    Miles, Nov 2, 2004
    #1
  2. Hi Miles,

    If you use the [Lines/Curves][Turned Angle] Command you can do this quite
    easily without extra software.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Nov 2, 2004
    #2
  3. Miles

    Matt W Guest

    Try this... (it's not the cleanest, but it'll do the job)

    Code:
    (defun C:FootPrint ( / os cmd sa or pt1 pt2 ang)
    (setq os (getvar "osmode"))
    (setq sa (getvar "snapang"))
    (setq or (getvar "orthomode"))
    (setq cmd (getvar "cmdecho"))
    (setvar "cmdecho" 0)
    (setvar "osmode" 0)
    (initget 1)
    (setq pt1 (getpoint "\n Pick starting point... "))
    (initget 1)
    (setq pt2 (getpoint "\n Pick next point... " pt1))
    (setq ang (angle pt1 pt2))
    (setvar "snapang" ang)
    (command "line" pt1 pt2 "")
    (setvar "orthomode" 1)
    (command "_line" pt2)
    (while (> (getvar "cmdactive") 0) (command pause))
    (setvar "cmdecho" cmd)
    (setvar "osmode" os)
    (setvar "orthomode" or)
    (setvar "snapang" sa)
    (princ)
    )
    
    (princ "\n Type FOOTPRINT to start program.")
    (princ)
    
     
    Matt W, Nov 2, 2004
    #3
  4. Miles

    ECCAD Guest

    Miles,
    Try this.

    (defun C:bout ()
    (setvar "CMDECHO" 0)
    (setq OSM (getvar "OSMODE"))
    (setq ORT (getvar "ORTHOMODE"))
    (setvar "OSMODE" 0); NONe
    (setvar "ORTHOMODE" 0); Off
    (setq PX (getpoint "\nPick First Building Corner:"))
    (setq P1 (getpoint "\nPick Next Corner:"))
    (command "_Line" PX P1 ""); draw first line
    (setq x nil)
    (while (not x)
    (setvar "LASTPOINT" P1)
    (setq P2 (getpoint P1 "\nPick Next Corner:\n"))
    (if P2
    (progn
    (command "_Line" "_per" P1 P2 ""); next line
    (setq P1 P2)
    ); progn
    (setq x 1)
    ); if
    ); while
    (setvar "OSMODE" OSM)
    (setvar "ORTHOMODE" ORT)
    (princ)
    ); function

    Bob
     
    ECCAD, Nov 2, 2004
    #4
  5. Miles

    alex Guest

    here is another one to try:

    ;orthogonal polylines -by alex konieczka
    (DEFUN C:eek:rp ()
    (graphscr)
    (setq twopi 6.283185307)(setq pio2 (/ twopi 4.0))
    (setq p1 (getpoint "Enter First Point: ") pp1)
    (setq p2 (getpoint p1 "Enter Next Point: "))
    (command "Pline" p1 p2)
    (setq a1 (angle p1 p2)) (setq oa a1)
    (setq p1 p2)

    (while (setq p2 (getpoint p1 "Enter Next Point"))
    (setq dp (cadr (grread 1)))(setq d1 (distance p1 p2))
    (setq da1 (+ a1 twopi)) (setq da2 (- a1 twopi))
    (setq dp1 (polar p1 da1 d1)) (setq dp2 (polar p1 da2 d1))
    (if (> (distance dp dp1) (distance dp dp2)) (setq a1 (+ a1 pio2)) (setq a1
    (- a1 pio2)))
    (if (> a1 twopi) (setq a1 (- a1 twopi)))
    (if (< a1 0) (setq a1 (+ a1 twopi)))
    (setq p2 (polar p1 a1 d1))
    (command p1 p2)
    (setq p1 p2)(setq oa a1)
    )
    (command pp1 "")
    (princ)
    )
     
    alex, Nov 4, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.