Author Topic: divide minus intermediates  (Read 13037 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
divide minus intermediates
« on: November 20, 2003, 09:18:08 AM »
hmmm wasn't sure how to title this one but i was also thinking it would be nice to come up with an easier way to divide a frame which has intermediate bracing into equal openings. so you could pick the overall frame then the number of intermediates and their width and it might be good to have the option to enter several different widths. then it would divide it so when you place the centerline of the brace on the node all the openings would be equal. did i explain that ok? anybody know of a way to automate this process?

dan

ELOQUINTET

  • Guest
divide minus intermediates
« Reply #1 on: November 20, 2003, 09:18:51 AM »
whoops sorry bout that  :oops:

daron

  • Guest
divide minus intermediates
« Reply #2 on: November 20, 2003, 09:58:45 AM »
Sorry about what? Are you talking about a dcl file or what? I don't think I understand.

hendie

  • Guest
divide minus intermediates
« Reply #3 on: November 20, 2003, 09:59:28 AM »
double posting I think

daron

  • Guest
divide minus intermediates
« Reply #4 on: November 20, 2003, 10:04:27 AM »
I know. I deleted the other one. Shhh, don't tell him. I want him to go crazy trying to figure it out.

ELOQUINTET

  • Guest
divide minus intermediates
« Reply #5 on: November 20, 2003, 10:27:43 AM »
hmmm how do i explain it better. i have a big ladder frame and i want the openings to equal spaces. i would like to be able to draw a line from the interior end of the frame to the other then enter the number of mullions and their widths. it would subtract the total ,half from each end of the line, then divide it into the number of mullions+1 giving you equal spaced openings. i hope i explained this right this time. the whole need for this is because i'm terrible at it for some reason. i'll try to post this once...

dan

ELOQUINTET

  • Guest
divide minus intermediates
« Reply #6 on: November 20, 2003, 10:36:58 AM »
it doesn't neccesarily have to be a dcl you could just be prompted from the command line right?

dan

daron

  • Guest
divide minus intermediates
« Reply #7 on: November 20, 2003, 10:37:26 AM »
Terrible at what? Writing the code? Yes, it can be done. Post what you've got started and I'm sure we'll all chip in to help you out. I'm sure if you inspect each line of code that you've gathered and read the help files on the lisp functions you'll be more able to write something like this. Take a screen shot of the drawing and post it up for all to see. A picture is worth a thousand, right?

ELOQUINTET

  • Guest
divide minus intermediates
« Reply #8 on: November 20, 2003, 11:15:19 AM »
terrible at dividing was what i was referring to but yes terrible at writing code too. i'm a beginner and am studying code that you guys write for me but am not ready yet to write my own. i can do basic stuff but nothing as complicated as this. help please

dan

ELOQUINTET

  • Guest
divide minus intermediates
« Reply #9 on: November 20, 2003, 03:58:32 PM »
hmmm noones answering my posts why?  :cry:

dan

daron

  • Guest
divide minus intermediates
« Reply #10 on: November 20, 2003, 04:07:04 PM »
For starters, I'd like to see a screen shot of what you are trying to accomplish. I can visualize a visual a whole lot quicker than I can visualize what you are trying to say. Personally, I'd say it's about time you start learning this stuff. The only way I can help is if you explain what this is (object/layer type)?
Quote
easier way to divide a frame which has intermediate bracing into equal openings

What objects are frames and braces made out of? What layers are they on?

ELOQUINTET

  • Guest
divide minus intermediates
« Reply #11 on: November 20, 2003, 04:54:02 PM »
ok daron i posted a little example at the lilly pond.

dan

daron

  • Guest
divide minus intermediates
« Reply #12 on: November 20, 2003, 05:06:41 PM »
Would the divide command give you anything near what you want. It draws nodes or will insert blocks. All you have to do is draw a block of the mullion and put the insertion point between the mullion at the midpoint area.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
divide minus intermediates
« Reply #13 on: November 21, 2003, 12:29:43 AM »
dan,
from you dwg it looked like you needed this, i could be off base.

Pick the corner of the glass, then pick the diagonal corner to
establish the window size.
Enter the mull width (3.875). This could be hard coded.


NO error checking in this routine, thats up to you.  :D

Code: [Select]
(defun C:Mull (/ p1 p2 x1 x2 y1 y2 Pa Pb wWidth MullHt PLL
      paneCnt mullWidth paneWidth mullPt Up left
      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 "pick glass corner")
p2     (getpoint p1 "pick 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
MullHt (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 mullWidth (getreal "\nEnter Mull Width:  "))
  (setq paneWidth (/ (- wWidth (* (1- paneCnt) mullWidth)) paneCnt)
mullPt  PLL
  )
 
  (setvar "osmode" 0)
  (command "undo" "begin")
  ;; draw the Mulls
  (repeat (1- paneCnt)
    (setq MullPt (polar mullPt 0 paneWidth))
    (command "_line" mullPt (polar mullPt up mullHt) "")
    (command "_line"
    (polar mullPt 0 0.75)
    (polar (polar mullPt 0 0.75) up mullHt)
    ""
    )
    (setq mullPt (polar mullPt 0 mullWidth))
    (command "_line" mullPt (polar mullPt up mullHt) "")
    (command "_line"
    (polar mullPt left 0.75)
    (polar (polar mullPt left 0.75) up mullHt)
    ""
    )
  ) ; end repeat
;;;==========  Exit Sequence  ============
  (command "undo" "end")
  (setvar "osmode" useros)
  (setvar "CMDECHO" usercmd)
;;; Exit quietly
  (princ)
) ; end defun
(princ)
(prompt "Mullion routine loaded. Enter mull 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

  • Guest
divide minus intermediates
« Reply #14 on: November 21, 2003, 08:31:42 AM »
thanks cab that works great. i have another question though. let's say i am doing a glass wall and i want equal panes with a 1/2" gap between would i just omit this part of the code:

        (polar mullPt 0 0.75)
        (polar (polar mullPt 0 0.75) up mullHt)
        ""
    )
    (setq mullPt (polar mullPt 0 mullWidth))
    (command "_line" mullPt (polar mullPt up mullHt) "")
    (command "_line"
        (polar mullPt left 0.75)
        (polar (polar mullPt left 0.75) up mullHt)
        ""

also is there a way i could have it trim in between the 1/2" gaps top and bottom? thanks i really appreciate it.

dan

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
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

  • Guest
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

JohnK

  • Administrator
  • Seagull
  • Posts: 10625
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?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

ELOQUINTET

  • Guest
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

JohnK

  • Administrator
  • Seagull
  • Posts: 10625
divide minus intermediates
« Reply #19 on: November 21, 2003, 10:59:17 AM »
Ok.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
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

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

dan

ELOQUINTET

  • Guest
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

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
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

  • Guest
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

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
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

  • Guest
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