Author Topic: Adding to this lisp?  (Read 6252 times)

0 Members and 1 Guest are viewing this topic.

vinnyg

  • Guest
Adding to this lisp?
« on: November 09, 2005, 08:33:36 AM »
Hi everyone,

I wrote this lisp and it needs additional code to finish it correctly (the way I need it)

It draws a pier cap with reinforcing. The problem is when you run it, it's missing 2 items.
There are 2 horizontal bars, 1 at the top and 1 at the bottom. I'm trying to figure out what
lines to add so that the routine places 2 other horiz. bars equally spaced between the top
and bottom bars?? Any suggestions?

Here it is:

Code: [Select]
; CAPBARS.LSP A PROGRAM TO DRAW A PIER CAP
; WITH REINF. BARS


  (DEFUN DTR (A) (* PI (/ A 180.0)))
  (DEFUN RTD (A) (/ (* A 180.0) PI))
(DEFUN C:CAPBARS ()   
 (SETVAR "CMDECHO" 0)
 (SETQ Z (GETVAR "CLAYER"))
 (GRAPHSCR)
 (command "osnap" "off" "")



(SETQ P1  (GETPOINT  "\nStart point for construction: "))

(setq w (getdist "\nPierCap width?:"))
(setq h (getdist "\nPierCap height?:"))
(setq ang 1.5708)

(setq p2 (polar p1 (-(dtr 90) ang) w)
      p3 (polar p2 (+(dtr 0) ang) h)
      p4 (polar p3 (+(dtr 90) ang) w)
)   
 
  (setvar "clayer" "3")
  (setvar "cecolor" "7")
  (command "line" p1 p2 p3 p4 "close" "")
  (redraw) ; end of drawing the outline

  (command "dimclrt" "1" "")
  (command "dimclre" "1" "")
  (command "dimscale" "12" "")
  (command "lunits" "4" "")
  (command "dimunit" "4" "")
  (command "dimtsz" "1/16" "")
  (command "dimtad" "1" "")
  (command "dimtih" "off" "")
  (command "dimjust" "0" "")
  (command "dimtad" "1" "")

  (setvar "cecolor" "1")
  (setvar "clayer" "defpoints")
  (setq p5 (polar p1 (+(DTR 90) ANG) 14))
  (command "dim" "ver"p1 p4 p5 "")
  (setq p6 (polar p1 (+(dtr 180) ang) 14))
  (command "dim" "hor" p1 p2 p6 "")
  (command "exit" "")
  (command "zoom" "e" "")
  (command "zoom" "0.9x" "")
  (redraw)


(setq bp1 (getpoint "\nStart point for reinf at lower left corner of piercap: "))


  (setq BW (getdist "\nPierCap width?:"))
  (setq BH (getdist "\nPierCap Height?:"))
  (setq ang 1.5708)
  (setq bp2 (polar bp1 (-(dtr 90) ang) bw)
      bp3 (polar bp2 (+(dtr 0) ang) bh)
      bp4 (polar bp3 (+(dtr 90) ang) bw)
  )   
 
  (setq bp5 (polar bp1 (-(dtr 90) ang) 3.5))
  (setq bp9 (polar bp5 (+(dtr 0) ang) 3))
  (setq bp10 (polar bp2 (+(dtr 90) ang) 15))
  (setq bp11 (polar bp10 (+(dtr 0) ang) 3))
  (setq bp7 (polar bp3 (+(dtr 90) ang) 15))
  (setq bp12 (polar bp7 (+(dtr 180) ang) 2))
  (setq bp8 (polar bp4 (+(dtr 180) ang) 3))
  (setq bp13 (polar bp8 (-(dtr 90) ang) 3.5))
  (setq bp6 (polar bp4 (-(dtr 90) ang) 3.5))
  (setq bp13 (polar bp6 (+(dtr 180) ang) 2))
 

 
  (setvar "cecolor" "8")
  (setvar "clayer" "reinf")
  (command "ortho" "on" )
  (command "pline" bp11 bp9 bp13 bp12 "")
  (command "fillet" "r" 1 "fillet" "polyline" "L")
  (setvar "cecolor" "7")
  (redraw)


  (setq bp14 (polar bp1 (-(dtr 90) ang) 15))
  (setq bp15 (polar bp14 (+(dtr 0) ang) 4))
  (setq bp16 (polar bp2 (+(dtr 90) ang) 3.5))
  (setq bp17 (polar bp16 (+(dtr 0) ang) 4))
  (setq bp18 (polar bp3 (+(dtr 90) ang) 3.5))
  (setq bp19 (polar bp18 (+(dtr 180) ang) 3))
  (setq bp20 (polar bp4 (-(dtr 90) ang) 15))
  (setq bp21 (polar bp20 (+(dtr 180) ang) 3))
 
 

 
  (setvar "cecolor" "8")
  (setvar "clayer" "reinf")
  (command "ortho" "on" )
  (command "pline" bp15 bp17 bp19 bp21 "")
  (command "fillet" "r" 1 "fillet" "polyline" "L")
  (setq bp22 (polar bp4 (+(dtr 180) ang) 4))
  (setq bp23 (polar bp3 (+(dtr 180) ang) 4))
  (setq bp24 (polar bp22 (-(dtr 90) ang) 3))
  (setq bp25 (polar bp23 (+(dtr 90) ang) 3))
  (command "pline" bp24 bp25 "")
  (setq bp26 (polar bp1 (+(dtr 0) ang) 5))
  (setq bp27 (polar bp2 (+(dtr 0) ang) 5))
  (setq bp28 (polar bp26 (-(dtr 90) ang) 3))
  (setq bp29 (polar bp27 (+(dtr 90) ang) 3))
  (command "pline" bp28 bp29 "")
  (setq bp30 (polar bp28 (+(dtr 90) ang) 0.25))
  (command "circle" bp30 "D" 0.50)
  (setq bp31 (polar bp29 (-(dtr 90) ang) 0.25))
  (command "circle" bp31 "D" 0.50)
  (setq bp32 (polar bp24 (+(dtr 90) ang) 0.25))
  (command "circle" bp32 "D" 0.50)
  (setq bp33 (polar bp25 (-(dtr 90) ang) 0.25))
  (command "circle" bp33 "D" 0.50)
  (setvar "cecolor" "7")
  (setvar "clayer" "text")
  (redraw)


  (redraw)
  (princ)
) ; end of defun

Thanks,

vinnyg

<EDIT: ADDED CODE TAGS>
« Last Edit: November 09, 2005, 01:44:24 PM by CAB »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Adding to this lisp?
« Reply #1 on: November 09, 2005, 03:06:44 PM »
"A picture is worth a thousands words." :-)   

Would you upload a drawing with the desired object?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Adding to this lisp?
« Reply #2 on: November 09, 2005, 03:35:34 PM »
After fixing a number of small errors and omissions (ended some commands with "" when not needed, added check for the layers used and added if not there.) these are the results I get....something doesn't look quite right......what should the final result look like?

vinnyg

  • Guest
Re: Adding to this lisp?
« Reply #3 on: November 09, 2005, 06:04:08 PM »

I will be happy to upload screen shot of the "Pier Cap" as soon as I discover how to
do it??

Somebody, please send instructions.....

I have it ready as a BMP file?

thanks.

vinnyg

Bob Wahr

  • Guest
Re: Adding to this lisp?
« Reply #4 on: November 09, 2005, 06:07:35 PM »
On the bar that has
Quote
Pages: [1] | Go Up                         Reply | Notify of replies | Mark unread | Print 
below the last post, click reply.  On that page, click "Additional options"  You should see the attachment bit.

vinnyg

  • Guest
Re: Adding to this lisp?
« Reply #5 on: November 10, 2005, 09:43:10 AM »
I have very limited options as to how I can save and send this dwg file.....I'm working in R14 and can only
save as bmp, dwf and dwg that this forum allows to post. So which one do I attach? Help!

vinnyg

Bob Wahr

  • Guest
Re: Adding to this lisp?
« Reply #6 on: November 10, 2005, 10:50:41 AM »
I'd go with the bmp so it can easily be seen.  Of course, everyone here should have the ability to handle dwg and dwf as well.

vinnyg

  • Guest
Re: Adding to this lisp?
« Reply #7 on: November 10, 2005, 11:01:51 AM »
OK, Here it is


Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Adding to this lisp?
« Reply #8 on: November 10, 2005, 12:44:36 PM »
OK, Vinny,
Here it is in a working order. Note that you have duplicated a number of actions, only a few of which I eliminated. Also, I changed the layer for the dimensions to "Dims" since you cannot (entmake) the Defpoints layer and the routine crashed if that layer didn't exist.

Agian, there is quite a bit of optimization you could do to this, but it works as a starting point.
Code: [Select]
; CAPBARS.LSP A PROGRAM TO DRAW A PIER CAP
; WITH REINF. BARS


  (DEFUN DTR (A) (* PI (/ A 180.0)))
  (DEFUN RTD (A) (/ (* A 180.0) PI))
(DEFUN C:CAPBARS (/ ang bh bp1 bp10 bp11 bp12 bp13 bp14 bp15 bp16 bp17 bp18 bp19
    bp2 bp20 bp21 bp22 bp23 bp24 bp25 bp26 bp27 bp28 bp29 bp3 bp30
    bp31 bp32 bp33 bp4 bp5 bp6 bp7 bp8 bp9 bw h p1 p2 p3 p4 p5 p6 w
    z ss dist spacing)   
(SETVAR "CMDECHO" 0)
(SETQ Z (GETVAR "CLAYER")
      osmode (getvar "osmode")
      )
(GRAPHSCR)
(setvar "osmode" 0)
  (mapcar '(lambda (x)
     (if (not (tblsearch "layer" x))
       (entmake (list '(0 . "LAYER")
      '(100 . "AcDbSymbolTableRecord")
      '(100 . "AcDbLayerTableRecord")
      (cons 2 x)
      '(6 . "Continuous")
      '(62 . 7)
      '(70 . 0)
      )
)
       )
     )
  '("3" "Dims" "reinf" "text")
  )

(SETQ P1  (GETPOINT  "\nStart point for construction: "))

(setq w (getdist "\nPierCap width?:"))
(setq h (getdist "\nPierCap height?:"))
(setq ang 1.5708)

(setq p2 (polar p1 (-(dtr 90) ang) w)
      p3 (polar p2 (+(dtr 0) ang) h)
      p4 (polar p3 (+(dtr 90) ang) w)
)   

  (setvar "clayer" "3")
  (setvar "cecolor" "7")
  (command "line" p1 p2 p3 p4 "close")
  (redraw) ; end of drawing the outline

  (command "dimclrt" "1")
  (command "dimclre" "1")
  (command "dimscale" "12")
  (command "lunits" "4")
  (command "dimunit" "4")
  (command "dimtsz" "1/16")
  (command "dimtad" "1")
  (command "dimtih" "off")
  (command "dimjust" "0")
  (command "dimtad" "1")

  (setvar "cecolor" "1")
  (setvar "clayer" "Dims")
  (setq p5 (polar p1 (+(DTR 90) ANG) 14))
  (command "dim" "ver" p1 p4 p5 "")
  (setq p6 (polar p1 (+(dtr 180) ang) 14))
  (command "dim" "hor" p1 p2 p6 "")
  (command "exit" )
  (command "zoom" "e" )
  (command "zoom" "0.9x" )
  (redraw)


(setq bp1 p1);(getpoint "\nStart point for reinf at lower left corner of piercap: "))


  (setq BW w);(getdist "\nPierCap width?:"))
  (setq BH h);(getdist "\nPierCap Height?:"))
  ;(setq ang 1.5708)
  (setq bp2 (polar bp1 (-(dtr 90) ang) bw)
      bp3 (polar bp2 (+(dtr 0) ang) bh)
      bp4 (polar bp3 (+(dtr 90) ang) bw)
  )   

  (setq bp5 (polar bp1 (-(dtr 90) ang) 3.5))
  (setq bp9 (polar bp5 (+(dtr 0) ang) 3))
  (setq bp10 (polar bp2 (+(dtr 90) ang) 15))
  (setq bp11 (polar bp10 (+(dtr 0) ang) 3))
  (setq bp7 (polar bp3 (+(dtr 90) ang) 15))
  (setq bp12 (polar bp7 (+(dtr 180) ang) 2))
  (setq bp8 (polar bp4 (+(dtr 180) ang) 3))
  (setq bp13 (polar bp8 (-(dtr 90) ang) 3.5))
  (setq bp6 (polar bp4 (-(dtr 90) ang) 3.5))
  (setq bp13 (polar bp6 (+(dtr 180) ang) 2))
 

 
  (setvar "cecolor" "8")
  (setvar "clayer" "reinf")
  (command "ortho" "on" )
  (command "pline" bp11 bp9 bp13 bp12 "")
  (command "fillet" "r" 1 "fillet" "polyline" "L")
  (setvar "cecolor" "7")
  (redraw)


  (setq bp14 (polar bp1 (-(dtr 90) ang) 15))
  (setq bp15 (polar bp14 (+(dtr 0) ang) 4))
  (setq bp16 (polar bp2 (+(dtr 90) ang) 3.5))
  (setq bp17 (polar bp16 (+(dtr 0) ang) 4))
  (setq bp18 (polar bp3 (+(dtr 90) ang) 3.5))
  (setq bp19 (polar bp18 (+(dtr 180) ang) 3))
  (setq bp20 (polar bp4 (-(dtr 90) ang) 15))
  (setq bp21 (polar bp20 (+(dtr 180) ang) 3))
 
 

 
  (setvar "cecolor" "8")
  (setvar "clayer" "reinf")
  (command "ortho" "on" )
  (command "pline" bp15 bp17 bp19 bp21 "")
  (command "fillet" "r" 1 "fillet" "polyline" "L")
  (setq bp22 (polar bp4 (+(dtr 180) ang) 4))
  (setq bp23 (polar bp3 (+(dtr 180) ang) 4))
  (setq bp24 (polar bp22 (-(dtr 90) ang) 3))
;;;  (setq bp25 (polar bp23 (+(dtr 90) ang) 3))
;;;  (command "pline" bp24 bp25 "")
  (setq ss (ssadd))
  (setq bp26 (polar bp1 (+(dtr 0) ang) 5))
  (setq bp27 (polar bp2 (+(dtr 0) ang) 5))
  (setq bp28 (polar bp26 (-(dtr 90) ang) 3))
  (setq bp29 (polar bp27 (+(dtr 90) ang) 3))
  (command "pline" bp28 bp29 "")
  (ssadd (entlast) ss)
  (setq bp30 (polar bp28 (+(dtr 90) ang) 0.25))
  (command "circle" bp30 "D" 0.50)
  (ssadd (entlast) ss)
  (setq bp31 (polar bp29 (-(dtr 90) ang) 0.25))
  (command "circle" bp31 "D" 0.50)
  (ssadd (entlast) ss)
  (setq dist (distance bp28 bp24))
  (setq spacing (/ dist 3))
  (command "_.array" ss "" "r" 4 1 spacing)
;;;  (setq bp32 (polar bp24 (+(dtr 90) ang) 0.25))
;;;  (command "circle" bp32 "D" 0.50)
;;;  (setq bp33 (polar bp25 (-(dtr 90) ang) 0.25))
;;;  (command "circle" bp33 "D" 0.50)
  (setvar "cecolor" "7")
  (setvar "clayer" "text")
  (redraw)
  (princ)
) ; end of defun

vinnyg

  • Guest
Re: Adding to this lisp?
« Reply #9 on: November 10, 2005, 01:04:52 PM »
SUPER! IT WORKS! THANKS JEFF M.

How did you do that?  And so fast!

Thanks Again,

vinny

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Adding to this lisp?
« Reply #10 on: November 10, 2005, 02:06:00 PM »
You're welcome!
When I get a bit of free time I'll re-write this in a more compact format to show you how you can eliminate much of your code and repetitive items.

Just a question about something that seemed odd to me. You use different clearnces for the bars at the top, bottom and sides. Is this intentional? I don't do that much work in this area, but when I do these clearances are usually the same. If what you use is S.O.P. then that explains why I don't do structural.... :)

vinnyg

  • Guest
Re: Adding to this lisp?
« Reply #11 on: November 10, 2005, 03:12:35 PM »
Actually I do more Architectural as opposed to Structural, but since
the bars overlap at different places, I wanted to make sure they
clear each other. Does that make since? Anyway I appreciate your
time and thought that went into this!

vinnyg

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Adding to this lisp?
« Reply #12 on: November 10, 2005, 03:27:20 PM »
AAAHHHH! I understand now, we do that here all the time and make sure the contractor knows that "This here drawing is a visual representaion of what you are to build. Just make sure you follow the specs."

I'm glad I can help others trying to learn. It helps me learn new things and also keep the old ones from getting rusty.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Adding to this lisp?
« Reply #13 on: November 10, 2005, 05:10:50 PM »
As promised, here is a modified version that runs somewhat quicker. I think the reason is that I've removed all the calls to (DTR) by providing fixed vars for those values. There are other methods that could be used, I just wanted to show you one way that could make your next project a bit simpler.

So by doing this: (setq d90 (/ pi 2)) I can then use it in the polar function thusly: (polar p1 d90 5.0) which is far easier to type and trouble shoot than is (polar p1 (+ (DTR 90) ang) 5.0), IMHO.
Code: [Select]
;;; CAPBARS.LSP A PROGRAM TO DRAW A PIER CAP
;;; WITH REINF. BARS, by VinceG. Modified by Jeff_M

(DEFUN C:CAPBARS (/ clay d0 d180 d270 d90 h osmode p1 p10 p11 p12 p13 p14 p2
                   p3 p4 p5 p6 p7 p8 p9 spacing ss w x)
  (SETVAR "CMDECHO" 0)
  (SETQ clay   (GETVAR "CLAYER")
osmode (getvar "osmode")
  )
  (setvar "osmode" 0)
  (mapcar '(lambda (x)
     (if (not (tblsearch "layer" x))
       (entmake (list '(0 . "LAYER")
      '(100 . "AcDbSymbolTableRecord")
      '(100 . "AcDbLayerTableRecord")
      (cons 2 x)
      '(6 . "Continuous")
      '(62 . 7)
      '(70 . 0)
)
       )
     )
   )
  '("3" "Dims" "reinf" "text")
  )
;;;initialize values
  (SETQ P1   (GETPOINT "\nStart point for construction: ")
w    (getdist "\nPierCap width?:")
h    (getdist "\nPierCap height?:")
d0   0.0
d90  (/ pi 2)
d180 pi
d270 (* pi 1.5)
  )
;;;calc & draw outline
  (setq p2 (polar p1 d0 w)
p3 (polar p2 d90 h)
p4 (polar p3 d180 w)
  )
  (setvar "clayer" "3")
  (setvar "cecolor" "7")
  (command "line" p1 p2 p3 p4 "close")
;;;; end of drawing the outline
;;;dimension it
  (command "dimclrt" "1")
  (command "dimclre" "1")
  (command "dimscale" "12")
  (command "lunits" "4")
  (command "dimunit" "4")
  (command "dimtsz" "1/16")
  (command "dimtad" "1")
  (command "dimtih" "off")
  (command "dimjust" "0")
  (command "dimtad" "1")
  (setvar "cecolor" "1")
  (setvar "clayer" "Dims")
  (command "dim" "ver" p1 p4 (polar p1 d180 14) "")
  (command "dim" "hor" p1 p2 (polar p1 d270 14) "")
  (command "exit")
  (command "zoom" "e")
  (command "zoom" "0.9x")
  ;;draw "U" bar 1
  (setq p5 (polar (polar p1 d0 3.5) d90 3.0)
;;over & up side/bottom gap
p6 (polar p5 d0 (- w 18.5))
;;length of bar at bottom
p7 (polar p5 d90 (- h 5.0))
;;cap height minus top/bottom gap
p8 (polar p7 d0 (- w 18.5))
   ;;length of bar at top
  )
  ;;draw "U" bar 2
  (setq p9  (polar (polar p2 d180 3.5) d90 4.0)
;;over & up side/bottom gap
p10 (polar p9 d180 (- w 18.5))
;;length of bar at bottom
p11 (polar p9 d90 (- h 7.0))
;;cap height minus top/bottom gap
p12 (polar p11 d180 (- w 18.5))
    ;;length of bar at top
  )
  ;;draw the "U" bars
  (setvar "cecolor" "8")
  (setvar "clayer" "reinf")
  (command "pline" p6 p5 p7 p8 "")
  (command "fillet" "r" 1 "fillet" "polyline" "L")
  (command "pline" p10 p9 p11 p12 "")
  (command "fillet" "r" 1 "fillet" "polyline" "L")
  ;;lower horiz bar
  (setq p13 (polar (polar p1 d90 5.0) d0 3.0)
p14 (polar p13 d0 (- w 6.0))
  )
  (setq ss (ssadd))
  ;;empty selection set to add the next 3 objects to
  (command "pline" p13 p14 "")
  (ssadd (entlast) ss)
  (command "circle" (polar p13 d180 0.25) "D" 0.50)
  (ssadd (entlast) ss)
  (command "circle" (polar p14 d0 0.25) "D" 0.50)
  (ssadd (entlast) ss)
  ;;create top & 2 evenly spaced horizontal bars
  (setq spacing (/ (- h 9.0) 3))
  (command "_.array" ss "" "r" 4 1 spacing)
  ;;reset vars
  (setvar "cecolor" "bylayer")
  (setvar "clayer" clay)
  (setvar "osmode" osmode)
  (setvar "cmdecho" 1)
  (princ)
);; end of defun

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Adding to this lisp?
« Reply #14 on: November 10, 2005, 05:36:24 PM »
I started on this yesterday so I took jeff's first changes & added them to mine.
The changes I made were to condense the code & use some words that have more meaning to me.
Hope they make sense to you as well.

PS I see jeff beat me to the punch but just food for thought.
Hope you don't mind.

Code: [Select]
(defun c:capbars (/ dist down height left ll lr osmode p1 p2 p3 p4 right spacing ss ul
                  up ur width x usrlay usrcol sb
                 )

  (setvar "CMDECHO" 0)
  (setq usrlay (getvar "CLAYER")
        usrcol (getvar "cecolor")
        osmode (getvar "osmode")
  )
  (graphscr)
  (mapcar '(lambda (x)
             (if (not (tblsearch "layer" x))
               (entmake (list '(0 . "LAYER")
                              '(100 . "AcDbSymbolTableRecord")
                              '(100 . "AcDbLayerTableRecord")
                              (cons 2 x)
                              '(6 . "Continuous")
                              '(62 . 7)
                              '(70 . 0)
                        )
               )
             )
           )
          '("3" "Dims" "reinf" "text")
  )


  (setvar "osmode" 0)

  (if
    (and
      (setq ll (getpoint "\nStart point for construction: "))

      (setq width (getdist "\nPierCap width?:"))
      (setq height (getdist "\nPierCap height?:"))
    )
     (progn
       ;;  direction vectors to replace your code
       (setq up    (/ pi 2)     ; (+ (dtr 0) ang)
             left  pi           ; (+ (dtr 90) ang)
             down    (* pi 1.5) ; (+ (dtr 180) ang)
             right 0.0          ; (- (dtr 90) ang)
       )

       (setq lr (polar ll right width) ; lower right
             ur (polar lr up height)   ; upper right
             ul (polar ur left width)  ; upper left
       )

       (setvar "clayer" "3")
       (setvar "cecolor" "7")
       (command "line" ll lr ur ul "close")

       ;;  create a dimension style override
       (command "dimclrt" "1")
       (command "dimclre" "1")
       (command "dimscale" "12")
       (command "lunits" "4")
       (command "dimunit" "4")
       (command "dimtsz" "1/16")
       (command "dimtad" "1")
       (command "dimtih" "off")
       (command "dimjust" "0")
       (command "dimtad" "1")

       (setvar "cecolor" "1")
       (setvar "clayer" "dims")
       (command "_dimlinear" ll ul (polar ll left 14) "")
       (command "_dimlinear" ll lr (polar ll down 14) "")
       ;;(command "zoom" "e" "")
       ;;(command "zoom" "0.9x" "")

       (setq sb (* width 0.3)) ; set back amount
       (setq p4 (polar (polar ll right 3.5) up 3))
       (setq p1 (polar (polar lr left sb) up 3))
       (setq p2 (polar (polar ur left sb) down 2))
       (setq p3 (polar (polar ul right 3.5) down 2))
       (setvar "cecolor" "8")
       (setvar "clayer" "reinf")
       (command "pline" p1 p4 p3 p2 "")
       (command "fillet" "r" 1 "fillet" "polyline" "L")
       (setvar "cecolor" "7")

       (setq p1 (polar (polar ll right sb) up 4))
       (setq p2 (polar (polar lr left 3.5) up 4))
       (setq p3 (polar (polar ur left 3.5) down 3))
       (setq p4 (polar (polar ul right sb) down 3))
       (setvar "cecolor" "8")
       (setvar "clayer" "reinf")
       (command "pline" p1 p2 p3 p4 "")
       (command "fillet" "r" 1 "fillet" "polyline" "L")
       (setq ss (ssadd))


       (setq p2 (polar (polar ul down 4) right 3))

       (setq p3 (polar (polar ll up 5) right 3))
       (setq p4 (polar (polar lr up 5) left 3))
       (command "pline" p3 p4 "")
       (ssadd (entlast) ss)

       (setq p1 (polar p3 left 0.25))
       (command "circle" p1 "D" 0.50)
       (ssadd (entlast) ss)

       (setq p1 (polar p4 right 0.25))
       (command "circle" p1 "D" 0.50)
       (ssadd (entlast) ss)
       (setq dist (distance p3 p2))
       (setq spacing (/ dist 3))
       (command "_.array" ss "" "r" 4 1 spacing)
     ) ; progn
  ) ; endif
  (setvar "osmode" osmode)
  (setvar "CLAYER" usrlay)
  (setvar "cecolor" usrcol)
  (princ)
) ; end of defun
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.