Results 1 to 10 of 10

Thread: 2013: Help with existing LISP routine

  1. #1
    Member
    Join Date
    2012-10
    Posts
    5

    Default 2013: Help with existing LISP routine

    I found the attached LISP routine on my company's network. It draws a side view of a hex head bolt. It works pretty well although it does pop up a few errors at the end of the command. I would like to be able to use the command without errors and would like to make a couple modifications to it but I do not know much about LISP.

    The command draws the bolt as expected but after entering the orientation angle it does this:
    Code:
    Enter orientation angle <270.0 Degrees >:
    Unknown command "2DBOLT". Press F1 for help.
    
    Pick insert point:
    Unknown command "2DBOLT". Press F1 for help.
    Unknown command "2DBOLT". Press F1 for help.
    Unknown command "2DBOLT". Press F1 for help.
    Unknown command "2DBOLT". Press F1 for help.
    Unknown command "2DBOLT". Press F1 for help.
    Then it draws the bolt correctly. Any ideas why?

    Also...

    Currently you have to manually enter a distance for the grip (gap) between the bolt head and nut/washer, I would like to be able to pick the insertion point of the bolt and the insertion point of the nut and use these values to draw the bolt rather than manually entering the grip (gap) distance and rotation angle.

    Hopefully this all makes sense...

    I am using AutoCAD 2013.

    Thanks!



    [ModeratorAction] Please use [CODE ] Tags [/ModeratorAction]
    Attached Files Attached Files
    Last edited by RenderMan; 2013-02-19 at 01:36 PM.

  2. #2
    AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL
    Posts
    1,095

    Default Re: 2013: Help with existing LISP routine

    This thread should be moved to Programing => Lisp.

    You should find the person responsable for the code on your company's network. Suggest they look at using getdist, getangle, and getorient in place of getreal. Having multiple versions of 2DBOLT.LSP would lead to problems down the road.
    Tom Beauford P.S.M. - Civil 2013 on Windows 7 Pro
    Design Analysis - Leon County Public Works/Engineering
    2280 Miccosukee Rd. Tallahassee, FL 32308-5310
    Ph# (850)606-1516

  3. #3
    Member
    Join Date
    2012-10
    Posts
    5

    Default Re: 2013: Help with existing LISP routine

    The person that wrote this program no longer works for us and there is no one here that knows LISP that's why I am looking for help on here. I do not want multiple versions of the routine, I just want one that works correctly and does what I need it to do.

  4. #4
    AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL
    Posts
    1,095

    Default Re: 2013: Help with existing LISP routine

    Try this version:
    Code:
     (defun C:2DBOLT ()
        (setq OM (getvar "OSMODE"))
       (setvar "OSMODE" 0)
       (setq LYR (getvar "clayer"))
        (setq LR1 (tblsearch "layer" "BOLT"))
        (setq LR2 (tblsearch "layer" "CENTERLINE"))
        (setq LR3 (tblsearch "layer" "HIDDEN"))
        (if (= LR1 nil)
            (command "layer" "new" "BOLT" "color" "140" "BOLT" "d" "STEEL CONNECTION BOLTS" "BOLT" "lw" ".25" "BOLT" ""))
        (if (= LR2 nil)
            (command "layer" "new" "CENTERLINE" "color" "11" "CENTERLINE" "lt" "center2" "CENTERLINE" "d" "CENTERLINES, COLUMN LINES" "CENTERLINE" "lw" ".25" "CENTERLINE" ""))
        (if (= LR3 nil)
            (command "layer" "new" "HIDDEN" "color" "9" "HIDDEN" "lt" "HIDDEN2" "HIDDEN" "d" "HIDDEN OBJECTS" "HIDDEN" "lw" ".25" "HIDDEN" ""))
            (command "layer" "set" "BOLT" "")
       (setq DEFBS BS)
       (setq DEFLG LG)
       (setq DEFT TT)
       (setq DEFWT WT)
       (setq DEFANG ANG)
       (setq DEFHEADOP HEADOP)
       (princ "\nEnter bolt diameter <")
       (princ DEFBS)
       (setq BS (getdist " in >:"))
       (if (= BS NIL)
          (setq BS DEFBS)
       ) ;_ end of if
       (princ "Draw bolt hea(D) only or (E)ntire bolt  <")
       (princ DEFHEADOP)
       (setq HEADOP (getstring ">:"))
       (if (= HEADOP "")
          (setq HEADOP DEFHEADOP)
       ) ;_ end of if
       (setq HEADOP (strcase HEADOP))
       (if (= HEADOP "E")
          (progn (princ "Enter length of grip (gap) <")
                 (princ DEFLG)
                 (setq LG (getdist " in >:"))
                 (if (= LG NIL)
                    (setq LG DEFLG)
                 ) ;_ end of if
                 (princ "Show bolt body as (S)olid/(H)idden/(N)one  <")
                 (princ DEFT)
                 (setq TT (getstring ">:"))
                 (if (= TT "")
                    (setq TT DEFT)
                 ) ;_ end of if
                 (setq TT (strcase TT))
          ) ;_ end of progn
       ) ;_ end of if
       (if (= HEADOP "D")
          (setq LG 0.0)
       ) ;_ end of if
       (princ "Enter washer thickness <")
       (princ DEFWT)
       (setq WT (getdist " in>:"))
       (if (= WT NIL)
          (setq WT DEFWT)
       ) ;_ end of if
       (princ "\nEnter orientation angle <")
       (princ DEFANG)
       (setq ANG (cvunit (getangle " Degrees >:") "radian" "degree"))
       (if (= ANG NIL)
          (setq ANG DEFANG)
       ) ;_ end of if
       (setq ANG (+ ANG 90.0))
       (princ "\nANG=")
       (princ ANG)
       (command "ucs" "z" ANG)
       (princ ", then UCS")
       (princ)
       (setq P0 (getpoint "\n Pick insert point: "))
    ;(setq p0 (list (- (car p0) wt) (cadr p0)))
       (setq HEADOP (strcase HEADOP))
       (setq B (/ 1.0 2.0)) ;bolt rad
       (setq C1 (/ 15.0 16.0)) ;width across corners
       (setq C2 (/ 7.0 16.0))
       (setq CH (/ 11.0 16.0)) ;head height
       (setq C3 (/ 21.0 32.0))
       (setq C4 (/ 7.0 16.0))
       (setq C5 (/ 1.5 1.0))
       (setq C6 (/ 1.0 8.0)) ;champher
       (setq C7 (/ 1.0 4.0))
       (setq C8 (/ 3.0 8.0)) ;3 threads
       (setq WD (* 1.125 BS)) ;washer dia
       (setq BD (* BS B)) ;bolt dia
       (setq LH (* CH BS)) ;head height
       (setq LT (* C8 BS))
       (setq LB (+ LH LG))
       (setq L1 (* C1 BS))
       (setq L2 (* C2 BS))
       (setq L3 (* C3 BS))
       (setq L4 (* C4 BS))
       (setq L5 (* C5 BS))
       (setq L6 (* C6 BS))
       (setq LB1 (- LB L6))
       (setq CL1 (+ LB L1 C7 C7 LT)) ;length of cl
       (setq CL (+ L1 C7))
       (setq BD1 (- BD L6))
       (setq THL (+ BS BS C7)) ;head washer
       (setq W1 (list (car P0) (+ (cadr P0) WT)))
       (setq W2 (list (+ (car W1) WD) (cadr W1)))
       (setq W3 (list (car W2) (- (cadr W2) WT)))
       (setq W4 (list (- (car W3) L1 WD) (cadr W3)))
       (setq W5 (list (+ (car P0) L4) (cadr P0))) ;Bolt Head
       (setq P1 (list (+ (car P0) L1) (+ (cadr P0) WT)))
       (setq P2 (list (car P1) (+ (cadr P1) L2)))
       (setq P3 (list (car P0) (+ (cadr P1) LH)))
       (setq P4 (list (+ (car P3) L3) (cadr P3)))
       (setq P5 (list (+ (car P0) L4) (+ (cadr P0) WT)))
       (setq P6 (list (car P5) (+ (cadr P5) L2)))
       (setq P7 (list (- (car P0) L4) (+ (cadr P0) WT)))
       (setq P8 (list (car P7) (+ (cadr P7) L2))) ;center line
       (setq P9 (list (car P0) (+ (cadr P0) CL)))
       (setq P10 (list (car P9) (- (cadr P9) CL1 WT WT))) ;Bolt Shank
       (setq P11 (list (+ (car P0) BD) (- (cadr P0) LB WT)))
       (setq P12 (list (car P11) (- (cadr P11) LT)))
       (setq P13 (list (- (car P0) BD) (- (cadr P0) LB WT)))
       (setq P14 (list (car P13) (- (cadr P13) LT)))
       (setq P15 (list (car P0) (- (cadr P0) LB LT L6 WT)))
       (setq P16 (list (+ (car P15) BD1) (cadr P15)))
       (setq PS1 (list (+ (car P0) BD) (cadr P0)))
       (setq PS2 (list (car PS1) (- (cadr PS1) LG))) ;thread
       (setq P17 (list (- (car P12) L6) (+ (cadr P15) WT)))
       (setq P18 (list (car P17) (+ (cadr P17) LT))) ;draw center line
       (command "line" P9 P10 "")
       (command "chprop" "l" "" "layer" "centerline" "") ;draw bolt head
       (command "line" P1 P2 "")
       (command "mirror" "l" "" P9 P10 "")
       (command "line" P3 P4 "")
       (command "mirror" "l" "" P9 P10 "")
       (command "line" P7 P8 "")
       (command "mirror" "l" "" P9 P10 "")
       (command "arc" P6 P4 P2)
    ;   (command "arc" P6 P4 P2 "")
       (command "mirror" "l" "" P9 P10 "")
       (command "arc" P6 P3 P8)
    ;   (command "arc" P6 P3 P8 "")
       (command "mirror" "l" "" P9 P10 "") ;draw head washer
       (command "line" W1 W2 "")
       (command "mirror" "l" "" P9 P10 "")
       (command "line" W2 W3 "")
       (command "mirror" "l" "" P9 P10 "")
       (command "line" W3 W4 "")
       (command "mirror" "l" "" P9 P10 "")
       (if (= HEADOP "E")
          (progn ;draw bolt shank
             (command "line" P11 P12 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P13 P14 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P12 P14 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P15 P16 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P16 P12 "")
             (command "mirror" "l" "" P9 P10 "")
             (if (= TT "N")
                (setq PS1 PS2)
             ) ;_ end of if
             (if (= TT "H")
                (command "line" PS1 PS2 "")
             ) ;_ end of if
             (command "chprop" "l" "" "layer" "hidden" "")
             (command "mirror" "l" "" P9 P10 "")
             (if (= TT "S")
                (command "line" PS1 PS2 "")
             ) ;_ end of if
             (command "mirror" "l" "" P9 P10 "") ;draw thread
    ;         (command "line" P17 P18 "")
    ;         (command "chprop" "l" "" "layer" "hidden" "")
    ;         (command "mirror" "l" "" P9 P10 "") ;nut
             (setq P0 (list (car P0) (- (cadr P0) LG)))
             (setq P1 (list (+ (car P0) L1) (- (cadr P0) WT)))
             (setq P2 (list (car P1) (- (cadr P1) L2)))
             (setq P3 (list (car P0) (- (cadr P1) LH)))
             (setq P4 (list (+ (car P3) L3) (cadr P3)))
             (setq P5 (list (+ (car P0) L4) (- (cadr P0) WT)))
             (setq P6 (list (car P5) (- (cadr P5) L2)))
             (setq P7 (list (- (car P0) L4) (- (cadr P0) WT)))
             (setq P8 (list (car P7) (- (cadr P7) L2))) ;nut washer
             (setq W11 (list (car P0) (- (cadr P0) WT)))
             (setq W21 (list (+ (car W11) WD) (cadr W11)))
             (setq W31 (list (car W21) (+ (cadr W21) WT)))
             (setq W41 (list (- (car W31) L1 WD) (cadr W31))) ;DRAW NUT
             (command "line" P0 P1 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P1 P2 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P3 P4 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P5 P6 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P7 P8 "")
             (command "arc" P6 P4 P2)
    ;         (command "arc" P6 P4 P2 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "arc" P6 P3 P8) ;draw nut washer
    ;         (command "arc" P6 P3 P8 "") ;draw nut washer
             (command "line" W11 W21 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" W21 W31 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" W31 W41 "")
             (command "mirror" "l" "" P9 P10 "")
          ) ;_ end of progn
       ) ;_ end of if
       (command "ucs" "w")
    ;   (command "ucs" "w" "")
       (setq ANG (- ANG 90.0))
       (redraw)
       (setvar "OSMODE" OM)
       (command "layer" "set" LYR "")
       (princ)
    ) ;_ end of defun
    Tom Beauford P.S.M. - Civil 2013 on Windows 7 Pro
    Design Analysis - Leon County Public Works/Engineering
    2280 Miccosukee Rd. Tallahassee, FL 32308-5310
    Ph# (850)606-1516

  5. #5
    Member
    Join Date
    2012-10
    Posts
    5

    Default Re: 2013: Help with existing LISP routine

    Thank you Tom, its almost perfect! Is it possible to ask for the insertion point then using that point ask for the gap distance and use those 2 points to set the angle and draw the bolt?

  6. #6
    AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL
    Posts
    1,095

    Default Re: 2013: Help with existing LISP routine

    This should do it.
    Code:
     (defun C:2DBOLT ()
        (setq OM (getvar "OSMODE"))
       (setvar "OSMODE" 0)
       (setq LYR (getvar "clayer"))
        (setq LR1 (tblsearch "layer" "BOLT"))
        (setq LR2 (tblsearch "layer" "CENTERLINE"))
        (setq LR3 (tblsearch "layer" "HIDDEN"))
        (if (= LR1 nil)
            (command "layer" "new" "BOLT" "color" "140" "BOLT" "d" "STEEL CONNECTION BOLTS" "BOLT" "lw" ".25" "BOLT" ""))
        (if (= LR2 nil)
            (command "layer" "new" "CENTERLINE" "color" "11" "CENTERLINE" "lt" "center2" "CENTERLINE" "d" "CENTERLINES, COLUMN LINES" "CENTERLINE" "lw" ".25" "CENTERLINE" ""))
        (if (= LR3 nil)
            (command "layer" "new" "HIDDEN" "color" "9" "HIDDEN" "lt" "HIDDEN2" "HIDDEN" "d" "HIDDEN OBJECTS" "HIDDEN" "lw" ".25" "HIDDEN" ""))
            (command "layer" "set" "BOLT" "")
       (setq DEFBS BS)
       (setq DEFLG LG)
       (setq DEFT TT)
       (setq DEFWT WT)
       (setq DEFANG ANG)
       (setq DEFHEADOP HEADOP)
       (princ "\nEnter bolt diameter <")
       (princ DEFBS)
       (setq BS (getdist " in >:"))
       (if (= BS NIL)
          (setq BS DEFBS)
       ) ;_ end of if
       (princ "Draw bolt hea(D) only or (E)ntire bolt  <")
       (princ DEFHEADOP)
       (setq HEADOP (getstring ">:"))
       (if (= HEADOP "")
          (setq HEADOP DEFHEADOP)
       ) ;_ end of if
       (setq HEADOP (strcase HEADOP))
       (setq P0 (getpoint "\n Pick insert point: "))
       (if (= HEADOP "E")
          (progn (princ "Enter length of grip (gap) <")
                 (princ DEFLG)
                 (setq LG (getdist P0 " in >:"))
    ;             (setq LG (getdist " in >:"))
                 (if (= LG NIL)
                    (setq LG DEFLG)
                 ) ;_ end of if
                 (princ "Show bolt body as (S)olid/(H)idden/(N)one  <")
                 (princ DEFT)
                 (setq TT (getstring ">:"))
                 (if (= TT "")
                    (setq TT DEFT)
                 ) ;_ end of if
                 (setq TT (strcase TT))
          ) ;_ end of progn
       ) ;_ end of if
       (if (= HEADOP "D")
          (setq LG 0.0)
       ) ;_ end of if
       (princ "Enter washer thickness <")
       (princ DEFWT)
       (setq WT (getdist " in>:"))
       (if (= WT NIL)
          (setq WT DEFWT)
       ) ;_ end of if
       (princ "\nEnter orientation angle <")
       (princ DEFANG)
       (setq ANG (getangle P0 " Degrees >:"))
       (if (= ANG NIL)
          (setq ANG DEFANG)
          (setq ANG (cvunit ANG "radian" "degree"))
       ) ;_ end of if
       (princ "\nGot 1!")
       (setq ANG (+ ANG 90.0))
       (princ "\nGot 2!")
       (princ)
       (command "ucs" "z" ANG)
       (princ "\nGot 3!")
       (princ)
       (princ "\nP0")
       (setq P1 P0)
       (setq P0 (trans P0 0 1))
       (princ P0)
       (setq HEADOP (strcase HEADOP))
       (setq B (/ 1.0 2.0)) ;bolt rad
       (setq C1 (/ 15.0 16.0)) ;width across corners
       (setq C2 (/ 7.0 16.0))
       (setq CH (/ 11.0 16.0)) ;head height
       (setq C3 (/ 21.0 32.0))
       (setq C4 (/ 7.0 16.0))
       (setq C5 (/ 1.5 1.0))
       (setq C6 (/ 1.0 8.0)) ;champher
       (setq C7 (/ 1.0 4.0))
       (setq C8 (/ 3.0 8.0)) ;3 threads
       (setq WD (* 1.125 BS)) ;washer dia
       (setq BD (* BS B)) ;bolt dia
       (setq LH (* CH BS)) ;head height
       (setq LT (* C8 BS))
       (setq LB (+ LH LG))
       (setq L1 (* C1 BS))
       (setq L2 (* C2 BS))
       (setq L3 (* C3 BS))
       (setq L4 (* C4 BS))
       (setq L5 (* C5 BS))
       (setq L6 (* C6 BS))
       (setq LB1 (- LB L6))
       (setq CL1 (+ LB L1 C7 C7 LT)) ;length of cl
       (setq CL (+ L1 C7))
       (setq BD1 (- BD L6))
       (setq THL (+ BS BS C7)) ;head washer
       (setq W1 (list (car P0) (+ (cadr P0) WT)))
       (setq W2 (list (+ (car W1) WD) (cadr W1)))
       (setq W3 (list (car W2) (- (cadr W2) WT)))
       (setq W4 (list (- (car W3) L1 WD) (cadr W3)))
       (setq W5 (list (+ (car P0) L4) (cadr P0))) ;Bolt Head
       (setq P1 (list (+ (car P0) L1) (+ (cadr P0) WT)))
       (setq P2 (list (car P1) (+ (cadr P1) L2)))
       (setq P3 (list (car P0) (+ (cadr P1) LH)))
       (setq P4 (list (+ (car P3) L3) (cadr P3)))
       (setq P5 (list (+ (car P0) L4) (+ (cadr P0) WT)))
       (setq P6 (list (car P5) (+ (cadr P5) L2)))
       (setq P7 (list (- (car P0) L4) (+ (cadr P0) WT)))
       (setq P8 (list (car P7) (+ (cadr P7) L2))) ;center line
       (setq P9 (list (car P0) (+ (cadr P0) CL)))
       (setq P10 (list (car P9) (- (cadr P9) CL1 WT WT))) ;Bolt Shank
       (setq P11 (list (+ (car P0) BD) (- (cadr P0) LB WT)))
       (setq P12 (list (car P11) (- (cadr P11) LT)))
       (setq P13 (list (- (car P0) BD) (- (cadr P0) LB WT)))
       (setq P14 (list (car P13) (- (cadr P13) LT)))
       (setq P15 (list (car P0) (- (cadr P0) LB LT L6 WT)))
       (setq P16 (list (+ (car P15) BD1) (cadr P15)))
       (setq PS1 (list (+ (car P0) BD) (cadr P0)))
       (setq PS2 (list (car PS1) (- (cadr PS1) LG))) ;thread
       (setq P17 (list (- (car P12) L6) (+ (cadr P15) WT)))
       (setq P18 (list (car P17) (+ (cadr P17) LT))) ;draw center line
       (command "line" P9 P10 "")
       (command "chprop" "l" "" "layer" "centerline" "") ;draw bolt head
       (command "line" P1 P2 "")
       (command "mirror" "l" "" P9 P10 "")
       (command "line" P3 P4 "")
       (command "mirror" "l" "" P9 P10 "")
       (command "line" P7 P8 "")
       (command "mirror" "l" "" P9 P10 "")
       (command "arc" P6 P4 P2)
    ;   (command "arc" P6 P4 P2 "")
       (command "mirror" "l" "" P9 P10 "")
       (command "arc" P6 P3 P8)
    ;   (command "arc" P6 P3 P8 "")
       (command "mirror" "l" "" P9 P10 "") ;draw head washer
       (command "line" W1 W2 "")
       (command "mirror" "l" "" P9 P10 "")
       (command "line" W2 W3 "")
       (command "mirror" "l" "" P9 P10 "")
       (command "line" W3 W4 "")
       (command "mirror" "l" "" P9 P10 "")
       (if (= HEADOP "E")
          (progn ;draw bolt shank
             (command "line" P11 P12 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P13 P14 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P12 P14 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P15 P16 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P16 P12 "")
             (command "mirror" "l" "" P9 P10 "")
             (if (= TT "N")
                (setq PS1 PS2)
             ) ;_ end of if
             (if (= TT "H")
                (command "line" PS1 PS2 "")
             ) ;_ end of if
             (command "chprop" "l" "" "layer" "hidden" "")
             (command "mirror" "l" "" P9 P10 "")
             (if (= TT "S")
                (command "line" PS1 PS2 "")
             ) ;_ end of if
             (command "mirror" "l" "" P9 P10 "") ;draw thread
    ;         (command "line" P17 P18 "")
    ;         (command "chprop" "l" "" "layer" "hidden" "")
    ;         (command "mirror" "l" "" P9 P10 "") ;nut
             (setq P0 (list (car P0) (- (cadr P0) LG)))
             (setq P1 (list (+ (car P0) L1) (- (cadr P0) WT)))
             (setq P2 (list (car P1) (- (cadr P1) L2)))
             (setq P3 (list (car P0) (- (cadr P1) LH)))
             (setq P4 (list (+ (car P3) L3) (cadr P3)))
             (setq P5 (list (+ (car P0) L4) (- (cadr P0) WT)))
             (setq P6 (list (car P5) (- (cadr P5) L2)))
             (setq P7 (list (- (car P0) L4) (- (cadr P0) WT)))
             (setq P8 (list (car P7) (- (cadr P7) L2))) ;nut washer
             (setq W11 (list (car P0) (- (cadr P0) WT)))
             (setq W21 (list (+ (car W11) WD) (cadr W11)))
             (setq W31 (list (car W21) (+ (cadr W21) WT)))
             (setq W41 (list (- (car W31) L1 WD) (cadr W31))) ;DRAW NUT
             (command "line" P0 P1 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P1 P2 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P3 P4 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P5 P6 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" P7 P8 "")
             (command "arc" P6 P4 P2)
    ;         (command "arc" P6 P4 P2 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "arc" P6 P3 P8) ;draw nut washer
    ;         (command "arc" P6 P3 P8 "") ;draw nut washer
             (command "line" W11 W21 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" W21 W31 "")
             (command "mirror" "l" "" P9 P10 "")
             (command "line" W31 W41 "")
             (command "mirror" "l" "" P9 P10 "")
          ) ;_ end of progn
       ) ;_ end of if
       (command "ucs" "w")
    ;   (command "ucs" "w" "")
       (setq ANG (- ANG 90.0))
       (redraw)
       (setvar "OSMODE" OM)
       (command "layer" "set" LYR "")
       (princ)
    ) ;_ end of defun
    Tom Beauford P.S.M. - Civil 2013 on Windows 7 Pro
    Design Analysis - Leon County Public Works/Engineering
    2280 Miccosukee Rd. Tallahassee, FL 32308-5310
    Ph# (850)606-1516

  7. #7
    Member
    Join Date
    2012-10
    Posts
    5

    Default Re: 2013: Help with existing LISP routine

    PERFECT!! Thank you so much for your time and effort. It is greatly appreciated!

  8. #8
    I could stop if I wanted to marko_ribar's Avatar
    Join Date
    2004-06
    Location
    Belgrade, Serbia, Europe
    Posts
    414

    Default Re: 2013: Help with existing LISP routine

    Please, review this post, especially attached *.dwg files... As you can see, BOLT has sides that when viewed from elevations, sliced parts are viewed as elliptical arcs - not ordinary arcs...

    Ketxu's first post is incorrect as also proposed Lee's functions because they all relate to 3pt arcs, but as in your case, if you are going to make just good looking picture and not real correct picture obtained from projecting 3D BOLT model, then your reply is as expected - without any good argument...
    Marko Ribar, d.i.a. (graduated engineer of architecture)

    M.R. on Youtube


  9. #9
    AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL
    Posts
    1,095

    Default Re: 2013: Help with existing LISP routine

    A Google search for "autocad bolt lsp" brings up many hits including a few I'm sure that draw nice 3D bolts if he wants anything fancier. I do Civil and never had use for a bolt drawing before.
    Tom Beauford P.S.M. - Civil 2013 on Windows 7 Pro
    Design Analysis - Leon County Public Works/Engineering
    2280 Miccosukee Rd. Tallahassee, FL 32308-5310
    Ph# (850)606-1516

  10. #10
    Member
    Join Date
    2012-10
    Posts
    5

    Default Re: 2013: Help with existing LISP routine

    Tom, what you provided is exactly what I need. Again, I appreciate your help very much.

Similar Threads

  1. Help with a lisp routine to add a 12" line to this routine
    By Orbytal.edge341183 in forum AutoLISP
    Replies: 3
    Last Post: 2012-11-14, 09:33 PM
  2. Combine three lisp routine into one routine.
    By BrianTFC in forum AutoLISP
    Replies: 1
    Last Post: 2012-02-08, 11:14 AM
  3. Replies: 9
    Last Post: 2012-01-21, 06:58 AM
  4. Calling up LISP routine from within another LISP
    By jimmy_goodall in forum AutoLISP
    Replies: 2
    Last Post: 2010-02-01, 05:41 AM
  5. Replies: 2
    Last Post: 2008-11-04, 07:03 AM

Posting Permissions

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