Author Topic: divide minus intermediates  (Read 5961 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10365
divide minus intermediates
« Reply #15 on: November 21, 2003, 09:38:45 AM »
dan,
Anything can be done given enough Time and MONEY. :D

Here is the Draw Line code commented.
As per your request, I'll need another picture :)  (eliminates so much ambiguity)

Code: [Select]

  ;; draw the Mulls
  (repeat (1- paneCnt)
    (setq MullPt (polar mullPt 0 paneWidth))
    ;; draw left outer vertical line
    (command "_line" mullPt (polar mullPt up mullHt) "")
    ;;Draw the left inner vertical line offset .75" to right
    (command "_line"
    (polar mullPt 0 0.75)
    (polar (polar mullPt 0 0.75) up mullHt)
    ""
    )
    ;;  move the pointer right by the mullion width
    (setq mullPt (polar mullPt 0 mullWidth))
    ;; draw the right outer vertical line
    (command "_line" mullPt (polar mullPt up mullHt) "")
    ;;  draw the right inner vertical line offset .75 to left
    (command "_line"
    (polar mullPt left 0.75)
    (polar (polar mullPt left 0.75) up mullHt)
    ""
    )
  ) ; end repeat
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.

Eloquintet

  • Gator
  • Posts: 3206
divide minus intermediates
« Reply #16 on: November 21, 2003, 10:36:29 AM »
cab not sure what this code is for. the mull code does exactly what i want for that canopy. i was wondering if something similar could be done for a glass wall. i'll upload a drawing to the pond shortly showing what i mean. thanks

dan
Dan

AutoCAD Architecture 2015

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9266
divide minus intermediates
« Reply #17 on: November 21, 2003, 10:40:57 AM »
Dan, what are you loking for? Are you just looking for someone to create an application for you or are you trying to complete this application your self?
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

Eloquintet

  • Gator
  • Posts: 3206
divide minus intermediates
« Reply #18 on: November 21, 2003, 10:53:00 AM »
ok it's uploaded to the pond. i'm trying to do something similar to the mull lisp. say i was given the overall size. i would like to be able to pick one corner then the opposite and number of panes. then it would divide the glass into equals and trim in between the panes like shown here. se7en i'm trying to pick this stuff up little by little and understand parts of the codes you guys have written for me. i would like to take a class or maybe really study some of the tutorials here but unfortunately i don't have much free time. i have downloaded the lisp bible from dsxcad but haven't had time yet to delve into it to much. i'm trying to learn believe me if i didn't want to know how to do this i wouldn't be here.

dan
Dan

AutoCAD Architecture 2015

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9266
divide minus intermediates
« Reply #19 on: November 21, 2003, 10:59:17 AM »
Ok.
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

CAB

  • Global Moderator
  • Seagull
  • Posts: 10365
divide minus intermediates
« Reply #20 on: November 30, 2003, 03:10:37 PM »
Dan,

Gap between panes is hard coded at 1/8 inch.


Code: [Select]
(defun C:Pane (/ p1 p2 x1 x2 y1 y2 Pa Pb wWidth PaneHt PLL
      paneCnt PaneWidth paneWidth PanePt Up left
      Gap usercmd useros)

  (setq usercmd (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (setq useros (getvar "osmode"))
  (setvar "osmode" 175)

  (Setq Up   (* pi 0.5)
left pi
  )
  (setq p1     (getpoint "\nPick glass corner")
p2     (getpoint p1 "\nPick diaganal glass corner")
x1     (car p1)
x2     (car p2)
y1     (cadr p1)
y2     (cadr p2)
Pa     (list x1 y2)
Pb     (list x2 y1)
wWidth (distance p1 pb) ; window width
PaneHt (distance p1 pa) ; window Hight
PLL    (list (if (< x1 x2)x1 x2) ; PLL point Lower Left corner
(if (< y1 y2) y1 y2)
)
  )

  (initget 7)
  (setq paneCnt (getint "\nEnter number of panes.  "))
  (initget 7)
  (setq Gap 0.128) ; preset at 1/8 inch
  (setq paneWidth (/ (- wWidth (* (1- paneCnt) Gap)) paneCnt)
PanePt  PLL
  )
 
  (setvar "osmode" 0)
  (command "undo" "begin")
  ;; draw the Glass Panes
  (repeat  paneCnt
    (command "_rectang" PanePt (strcat "@" (rtos PaneWidth 2) "," (rtos PaneHt 2)))
    (setq PanePt (polar PanePt 0 (+ PaneWidth Gap)))
  ) ; end repeat
;;;==========  Exit Sequence  ============
  (command "undo" "end")
  (setvar "osmode" useros)
  (setvar "CMDECHO" usercmd)
;;; Exit quietly
  (princ)
) ; end defun
(princ)
(prompt "\nWindow Pane routine loaded. Enter Pane to run")
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.

Eloquintet

  • Gator
  • Posts: 3206
divide minus intermediates
« Reply #21 on: December 01, 2003, 08:11:11 AM »
thanks cab works great exactly what the doctor ordered. preesh

dan
Dan

AutoCAD Architecture 2015

Eloquintet

  • Gator
  • Posts: 3206
divide minus intermediates
« Reply #22 on: December 01, 2003, 08:44:46 AM »
hey cab i overlooked something. is there a way to make it subtract an 1/8 from each end before it divides it into equal panes so you have caulk joints at the ends as well. thanks man

dan
Dan

AutoCAD Architecture 2015

CAB

  • Global Moderator
  • Seagull
  • Posts: 10365
divide minus intermediates
« Reply #23 on: December 01, 2003, 12:28:16 PM »
dan,

Code: [Select]
(defun C:Pane (/ p1 p2 x1 x2 y1 y2 Pa Pb wWidth PaneHt PLL
      paneCnt PaneWidth paneWidth PanePt Up left
      Gap usercmd useros)

  (setq usercmd (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (setq useros (getvar "osmode"))
  (setvar "osmode" 175)

  (Setq Up   (* pi 0.5)
left pi
  )
  (setq p1     (getpoint "\nPick glass frame corner")
p2     (getpoint p1 "\nPick diaganal glass corner")
x1     (car p1)
x2     (car p2)
y1     (cadr p1)
y2     (cadr p2)
Pa     (list x1 y2)
Pb     (list x2 y1)
wWidth (distance p1 pb) ; window width
PaneHt (distance p1 pa) ; window Hight
PLL    (list (if (< x1 x2)x1 x2) ; PLL point Lower Left corner
(if (< y1 y2) y1 y2)
)
  )

  (initget 7)
  (setq paneCnt (getint "\nEnter number of panes.  "))
  (initget 7)
  (setq Gap 0.128) ; preset at 1/8 inch
  (setq paneWidth (/ (- wWidth (* (1+ paneCnt) Gap)) paneCnt)
PanePt  (polar PLL 0 gap)
  )
 
  (setvar "osmode" 0)
  (command "undo" "begin")
  ;; draw the Glass Panes
  (repeat  paneCnt
    (command "_rectang" PanePt (strcat "@" (rtos PaneWidth 2) "," (rtos PaneHt 2)))
    (setq PanePt (polar PanePt 0 (+ PaneWidth Gap)))
  ) ; end repeat
;;;==========  Exit Sequence  ============
  (command "undo" "end")
  (setvar "osmode" useros)
  (setvar "CMDECHO" usercmd)
;;; Exit quietly
  (princ)
) ; end defun
(princ)
(prompt "\nWindow Pane routine loaded. Enter Pane to run")
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.

Eloquintet

  • Gator
  • Posts: 3206
divide minus intermediates
« Reply #24 on: December 01, 2003, 12:46:28 PM »
hmmm how is this one different from the last post? i tried it and it didn't do what i wanted which is to give me an 1/8 gap on each vertical end. so based on the glass size i pick it would offset in an 1/8 each side then divide that distance equally. do you get what i'm sayin? thanks for trying though  :D

dan
Dan

AutoCAD Architecture 2015

CAB

  • Global Moderator
  • Seagull
  • Posts: 10365
divide minus intermediates
« Reply #25 on: December 01, 2003, 01:04:36 PM »
I think i get what you are saying. :shock:

These lines are differant:

Code: [Select]
 (setq   paneWidth (/ (- wWidth (* (1+ paneCnt) Gap)) paneCnt)
   PanePt     (polar PLL 0 gap)


Did you try the code?
Did you zoom in on the left and right margins?
Did you not see a 1/8" gap?

 :roll: CAB :roll:
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.

Eloquintet

  • Gator
  • Posts: 3206
divide minus intermediates
« Reply #26 on: December 01, 2003, 01:14:00 PM »
ok it's cool now. i thought i had overwritten the old one with the new but i hadn't it works great now thank ya thank ya kind sir

dan
Dan

AutoCAD Architecture 2015