TenSecond408 Posted July 3, 2013 Posted July 3, 2013 Hello everyone I have wanted to create some type of LISP for a long time now. Iv done 1000's of handrail drawing in the past few years, and expect to do many many more. These rails are 1.50 x 1.50 square tubing, 16ga wall, 304 stainless or Mild Steel. The standard height is 42" which should never change. There are only a few variables when drawing these. When you have a handrail that has more than just the end uprights, the center distance of uprights can be no larger than 42". When a handrail is short enough to not need intermediate uprights, the center distance can be no larger than 50". I have included a sample drawing of how I layout my rail drawing for the shop to fabricate. I have shown, a rail with multiple uprights and one short one that doesn't require intermediate uprights. I would love to have a LISP designed to have a dialog box pop up that ask for: Handrail Length: 4" - 240" Material: Stainless or Mild Steel Once criteria is entered, the LISP draws the handrail and then creates a cut list, like I have shown in my sample. Is it possible to dimension and place text with the same LISP program? Thanks for all the help everyone! AJ Here is the sample file I have put together as an example of how I draw my shop drawings. SAMPLE.dwg Quote
neophoible Posted July 3, 2013 Posted July 3, 2013 (edited) I'm sure this is doable in LISP, but I don't know how much effort it would be for the gurus. I can set up a fairly simple dynamic block to do most of what you want for the single handrail (see attachment). The multi-upright is probably just as doable for a dynamic block expert. I'm not an expert; more of a dabbler at this point. Handrail SAMPLE w Block.dwg For the material, my approach would be to shorten the text and add a right-justified attribute for Mild or Stainless. Since it would be the same for all pcs, two of the attributes could just have fields that adjust to the one input for the first. Edited July 3, 2013 by neophoible added comments about attributes for material Quote
neophoible Posted July 3, 2013 Posted July 3, 2013 BTW, if you don't really need a full drawing, then the problem can be greatly simplified by having variables directly in the drawing for the multi-upright handrail. You just add breaks to show that there are more spaces than the couple shown and perhaps add a chart that is filled in (by a program, or by hand). We do a lot of this sort of thing for standard items that our shop builds regularly. This makes the programming easier, as there is nothing to draw, just dimensions (attributes, really) to fill in. Quote
TenSecond408 Posted July 3, 2013 Author Posted July 3, 2013 That method works pretty good. Just would need a bit of fine tuning. Just visual stuff really, such as: Keeping text centered under the cut tubes. Now if we could just get the multiple upright to work in the dynamic block. Iv never been real good at this dynamic block stuff, my school didn't teach us much in that area. Thanks for the help man Hopefully you sparked an idea in someones head to maybe figure it out! AJ Quote
TenSecond408 Posted July 3, 2013 Author Posted July 3, 2013 BTW, if you don't really need a full drawing, then the problem can be greatly simplified by having variables directly in the drawing for the multi-upright handrail. You just add breaks to show that there are more spaces than the couple shown and perhaps add a chart that is filled in (by a program, or by hand). We do a lot of this sort of thing for standard items that our shop builds regularly. This makes the programming easier, as there is nothing to draw, just dimensions (attributes, really) to fill in. This would be a much easier approach to making these drawings. We still would like to keep full size/fully drawn handrail drawings, its just easier for us to use for future references when a dimension needs to be pulled for a welder or whatever other reason may come up. Thanks again for helping me out! AJ Quote
neophoible Posted July 3, 2013 Posted July 3, 2013 This would be a much easier approach to making these drawings. We still would like to keep full size/fully drawn handrail drawings, its just easier for us to use for future references when a dimension needs to be pulled for a welder or whatever other reason may come up. Thanks again for helping me out! AJ Understood. We have such issues sometimes as well, and in those cases we usually have a program that will draw out the item so we can CAD measure it. But now it's clear you need what you're asking for. One thing that does come into play is the tolerance. What is the tolerance (or fuzz dimension) for going from one size to the next? In other words, you won't worry about adding an upright if the center distance were 42.001, would you? But you would have to go to the next one if it is over by a certain fraction of an inch., say 1/16", right? And is the cutoff at 51.500 exactly? Or perhaps also up to, say 1/16" over that? Quote
TenSecond408 Posted July 3, 2013 Author Posted July 3, 2013 Understood. We have such issues sometimes as well, and in those cases we usually have a program that will draw out the item so we can CAD measure it. But now it's clear you need what you're asking for. One thing that does come into play is the tolerance. What is the tolerance (or fuzz dimension) for going from one size to the next? In other words, you won't worry about adding an upright if the center distance were 42.001, would you? But you would have to go to the next one if it is over by a certain fraction of an inch., say 1/16", right? And is the cutoff at 51.500 exactly? Or perhaps also up to, say 1/16" over that? There isnt really any science for us on this. It would work just fine if we said their is no tolerance that needs to be considered. On the multiple uprights anything >42" centers will need a new upright and on a short rail anything >50" will need a new upright. Im messing around with trying to setup a dynamic block like you just did for the short rail, pretty complicated Thanks AJ Quote
David Bethel Posted July 3, 2013 Posted July 3, 2013 As a 'just cause' and to show how complicated an undertaking like this can be, here is a command line approach that uses the TRACE command that constructs the tubes : [b][color=BLACK]([/color][/b]defun c:hrail [b][color=FUCHSIA]([/color][/b]/ x y z q dy h m xx xs xp dq hz i fl cl tl ul ml[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]while [b][color=NAVY]([/color][/b]or [b][color=MAROON]([/color][/b]not x[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]not [b][color=GREEN]([/color][/b]< 4 x 240[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]initget 7[b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq x [b][color=MAROON]([/color][/b]getdist [color=#2f4f4f]"\nOverall Width S-S [b][color=GREEN]([/color][/b] 4-240 [b][color=GREEN])[/color][/b]: "[/color][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]initget 6[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq y [b][color=NAVY]([/color][/b]getdist [color=#2f4f4f]"\nHeight T-B <42>: "[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]or y [b][color=NAVY]([/color][/b]setq y 42.[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]initget 6[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq z [b][color=NAVY]([/color][/b]getdist [color=#2f4f4f]"\nTube Size <1.5>: "[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]or z [b][color=NAVY]([/color][/b]setq z 1.5[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq dq [b][color=NAVY]([/color][/b]cond [b][color=MAROON]([/color][/b][b][color=GREEN]([/color][/b]<= x 50[b][color=GREEN])[/color][/b] 0[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]T [b][color=GREEN]([/color][/b]fix [b][color=BLUE]([/color][/b]/ x 42[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]initget 4[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq q [b][color=NAVY]([/color][/b]getint [b][color=MAROON]([/color][/b]strcat [color=#2f4f4f]"\nMiddle Upright Qty <"[/color] [b][color=GREEN]([/color][/b]itoa dq[b][color=GREEN])[/color][/b] [color=#2f4f4f]">: "[/color][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]or q [b][color=NAVY]([/color][/b]setq q dq[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq dy [b][color=NAVY]([/color][/b]* [b][color=MAROON]([/color][/b]- y z[b][color=MAROON])[/color][/b] 0.5[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq h [b][color=NAVY]([/color][/b]getdist [b][color=MAROON]([/color][/b]strcat [color=#2f4f4f]"\nMid Rail Height <"[/color] [b][color=GREEN]([/color][/b]rtos dy 2 2[b][color=GREEN])[/color][/b] [color=#2f4f4f]">: "[/color][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]or h [b][color=NAVY]([/color][/b]setq h dy[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]initget 1 [color=#2f4f4f]"Mild Stainless"[/color][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq m [b][color=NAVY]([/color][/b]getkword [color=#2f4f4f]"\nMaterial - Mild/Stainless: "[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [color=#8b4513];;;HALF TUBE[/color] [b][color=FUCHSIA]([/color][/b]setq hz [b][color=NAVY]([/color][/b]* z 0.5[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [color=#8b4513];;;UPRIGHT SPACING[/color] [b][color=FUCHSIA]([/color][/b]setq xx [b][color=NAVY]([/color][/b]- x z[b][color=NAVY])[/color][/b] xs [b][color=NAVY]([/color][/b]/ xx [b][color=MAROON]([/color][/b]1+ q[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] xp hz[b][color=FUCHSIA])[/color][/b] [color=#8b4513];;;CENTER LINE LIST[/color] [b][color=FUCHSIA]([/color][/b]setq cl [b][color=NAVY]([/color][/b]list hz[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]repeat q [b][color=NAVY]([/color][/b]setq cl [b][color=MAROON]([/color][/b]cons [b][color=GREEN]([/color][/b]+ xp xs[b][color=GREEN])[/color][/b] cl[b][color=MAROON])[/color][/b] xp [b][color=MAROON]([/color][/b]+ xp xs[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq cl [b][color=NAVY]([/color][/b]cons [b][color=MAROON]([/color][/b]- x hz[b][color=MAROON])[/color][/b] cl[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq cl [b][color=NAVY]([/color][/b]reverse cl[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [color=#8b4513];;;MAIN FRAME LIST[/color] [b][color=FUCHSIA]([/color][/b]setq fl [b][color=NAVY]([/color][/b]list [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]car cl[b][color=GREEN])[/color][/b] 0 0[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]car cl[b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]- y hz[b][color=GREEN])[/color][/b] 0[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]last cl[b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]- y hz[b][color=GREEN])[/color][/b] 0[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]last cl[b][color=GREEN])[/color][/b] 0 0[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [color=#8b4513];;;UPRIGHT LIST[/color] [b][color=FUCHSIA]([/color][/b]setq i 1[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]repeat q [b][color=NAVY]([/color][/b]setq ul [b][color=MAROON]([/color][/b]cons [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]list [b][color=RED]([/color][/b]nth i cl[b][color=RED])[/color][/b] 0 0[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]list [b][color=RED]([/color][/b]nth i cl[b][color=RED])[/color][/b] [b][color=RED]([/color][/b]- y z[b][color=RED])[/color][/b] 0[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] ul[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq i [b][color=MAROON]([/color][/b]1+ i[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [color=#8b4513];;;MID SUPPORTS[/color] [b][color=FUCHSIA]([/color][/b]setq tl cl[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]while [b][color=NAVY]([/color][/b]> [b][color=MAROON]([/color][/b]length tl[b][color=MAROON])[/color][/b] 1[b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq ml [b][color=MAROON]([/color][/b]cons [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]list [b][color=RED]([/color][/b]+ [b][color=PURPLE]([/color][/b]car tl[b][color=PURPLE])[/color][/b] hz[b][color=RED])[/color][/b] h 0[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]list [b][color=RED]([/color][/b]- [b][color=PURPLE]([/color][/b]cadr tl[b][color=PURPLE])[/color][/b] hz[b][color=RED])[/color][/b] h 0[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] ml[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq tl [b][color=MAROON]([/color][/b]cdr tl[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setvar [color=#2f4f4f]"CMDECHO"[/color] 1[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setvar [color=#2f4f4f]"TRACEWID"[/color] z[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setvar [color=#2f4f4f]"THICKNESS"[/color] z[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setvar [color=#2f4f4f]"SNAPMODE"[/color] 0[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]command [color=#2f4f4f]"_.UCS"[/color] [color=#2f4f4f]"_W"[/color][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]command [color=#2f4f4f]"_.TRACE"[/color] [color=#2f4f4f]""[/color][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]foreach v fl [b][color=NAVY]([/color][/b]command v[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]command [color=#2f4f4f]""[/color][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]foreach v ml [b][color=NAVY]([/color][/b]command [color=#2f4f4f]"_.TRACE"[/color] [color=#2f4f4f]""[/color][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]command [b][color=MAROON]([/color][/b]car v[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]command [b][color=MAROON]([/color][/b]cadr v[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]command [color=#2f4f4f]""[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]foreach v ul [b][color=NAVY]([/color][/b]command [color=#2f4f4f]"_.TRACE"[/color] [color=#2f4f4f]""[/color][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]command [b][color=MAROON]([/color][/b]car v[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]command [b][color=MAROON]([/color][/b]cadr v[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]command [color=#2f4f4f]""[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] The parts list is very doable but even a lot more complex. -David Quote
LibertyOne Posted July 4, 2013 Posted July 4, 2013 What if the handrail is longer than the material being supplied? Where do you splice? Or do you have limits on the length or weight of the handrails? (for transport) And do you need base plates for anchoring the hand rail to the ground or floor? Quote
neophoible Posted July 4, 2013 Posted July 4, 2013 What if the handrail is longer than the material being supplied? Where do you splice? Or do you have limits on the length or weight of the handrails? (for transport) And do you need base plates for anchoring the hand rail to the ground or floor?He mentioned a max of 20' long, typical for USA, with no splice needed. I was curious about there being no kickplate, but guessed it must be mounted to the floor. Quote
steven-g Posted July 4, 2013 Posted July 4, 2013 Here's a teaser 0,1 & 2 just to see one way of doing it. Rail2.dwg Quote
piloche Posted July 13, 2013 Posted July 13, 2013 Bueno a quien le pueda interesar tengo hecho un lisp para dibujar tramos rectos (dimensiones en m/m ) pero soy nuevo en el foro y aun no se como se suben los archivos Quote
neophoible Posted July 19, 2013 Posted July 19, 2013 Bueno a quien le pueda interesar tengo hecho un lisp para dibujar tramos rectos (dimensiones en m/m )pero soy nuevo en el foro y aun no se como se suben los archivos "Good to whom it may concern I have done a lisp to draw straight segments (dimensions in m / m) but am new to the forum and still do not know how the files are uploaded." Google Translation. Welcome to the forum. By the way, I think that you are supposed to use English in this forum. It doesn't have to be perfect. Not sure what you are referring to here exactly, but to post code, just insert it as text then use the "#" option on the toolbar to enclose it in code quotes so that it is easily distinguishable. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.