TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: ELOQUINTET 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
-
whoops sorry bout that :oops:
-
Sorry about what? Are you talking about a dcl file or what? I don't think I understand.
-
double posting I think
-
I know. I deleted the other one. Shhh, don't tell him. I want him to go crazy trying to figure it out.
-
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
-
it doesn't neccesarily have to be a dcl you could just be prompted from the command line right?
dan
-
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?
-
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
-
hmmm noones answering my posts why? :cry:
dan
-
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)?
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?
-
ok daron i posted a little example at the lilly pond.
dan
-
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.
-
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
(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")
-
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
-
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)
;; 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
-
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, 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?
-
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
-
Ok.
-
Dan,
Gap between panes is hard coded at 1/8 inch.
(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")
-
thanks cab works great exactly what the doctor ordered. preesh
dan
-
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,
(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")
-
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
-
I think i get what you are saying. :shock:
These lines are differant:
(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:
-
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