Author Topic: Lisp in cm or meters for making stairs plan view  (Read 4831 times)

0 Members and 1 Guest are viewing this topic.

diago

  • Guest
Lisp in cm or meters for making stairs plan view
« on: January 02, 2015, 02:16:41 PM »
Hi again, I was wondering if someone has any lisp in cm or meters for making stairs in plan view. I found just lisp in inches , help pls. Thanks in advance guys.

kpblc

  • Bull Frog
  • Posts: 396
Re: Lisp in cm or meters for making stairs plan view
« Reply #1 on: January 02, 2015, 02:19:26 PM »
So post your code. Change code or write new are differentd tasks.
Sorry for my English.

diago

  • Guest
Re: Lisp in cm or meters for making stairs plan view
« Reply #2 on: January 02, 2015, 03:52:27 PM »
I saw this topic of ROB-GB :
http://www.theswamp.org/index.php?topic=37427.0
There is a code just for timber stairs I`d like to make this for simple concrete stairs that I could draw and set up in a simple house or building. I mean with not so much lines. By the way this code uses inches I`m looking for codes with cm input.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Lisp in cm or meters for making stairs plan view
« Reply #3 on: January 02, 2015, 04:21:19 PM »
I saw this topic of ROB-GB :
http://www.theswamp.org/index.php?topic=37427.0
There is a code just for timber stairs I`d like to make this for simple concrete stairs that I could draw and set up in a simple house or building. I mean with not so much lines. By the way this code uses inches I`m looking for codes with cm input.

Read it again...it's in CM

http://www.theswamp.org/index.php?topic=37427.msg424328#msg424328
Be your Best


Michael Farrell
http://primeservicesglobal.com/

kpblc

  • Bull Frog
  • Posts: 396
Re: Lisp in cm or meters for making stairs plan view
« Reply #4 on: January 02, 2015, 04:32:00 PM »
polar function (as i know) uses current units. So you should start this code at dwg started with acadiso.dwt template. Or change MEASUREMENT system variable (and don't forget to change LUNITS system variable).

P.S. I think code could be modified to be more flexibility and readable, but it will take too much time :( I haven't it, sorry.
Sorry for my English.

diago

  • Guest
Re: Lisp in cm or meters for making stairs plan view
« Reply #5 on: January 03, 2015, 11:37:36 PM »
I found this auto lisp from this web site : http://cadtips.cadalyst.com/misc-user-tools/tip-2294-draw-stairs-plan-view
but I don't know how to use it because it`s in inches and here is the code :
Code: [Select]
;;; CADALYST 07/08  www.cadalyst.com/code
;;; Tip 2294: Stairs.lsp    Draw Stairs in Plan View    (c) 2008 Kent Cooper

;;  by Kent Cooper, Schwam Architects, February 2008
;;
;;  Routines to draw straight-run and switch-back STAIRS in 2D Section and Plan.
;;
;;  Routines offer IBC & ADA (as of Feb. 2008) defaults of:
;;    7" maximum riser [in Public and Accessible stairs]; 7-3/4" in [non-accessible] Dwelling Units;
;;    11" minimum tread [in Public and Accessible stairs]; 10" in [non-accessible] Dwelling Units;
;;    44" stair run width; 36" when Dwelling Unit selected (also allowable in Public with occupancy <50);
;;    36" handrail height (middle of allowable range).
;;  These routines are not a substitute for knowledge of applicable codes and regulations.  They do NOT "force" values
;;  into code-compliant ranges, because these can be invalidated by local amendments (for example, New Jersey uses IBC
;;  but amends it to allow even higher risers and shorter treads in Dwelling Units).  The only forcing the routines do is to
;;  ask for a new overall stairwell width in a two-run stair plan, if the entered width is not at least twice the width of a stair
;;  run.  They do not check for other code elements, e.g. maximum rise between landings, possible omission of handrails
;;  in some very short runs, headroom, etc.
;;
;;  If even number of risers in two runs, routines offer default of equal runs; user can override.
;;  If odd number of risers in two runs, routines offer default of one more in lower run than upper run; user can override.
;;  "Aligned" treads at landing are drawn collinear in plan, nosings vertically aligned in section;
;;  "Offset" are drawn one tread-width apart for cleanest inside-turn handrail alignment.
;;  Default nosing projection in section is 1" (IBC allows up to 1-1/4", ADA up to 1-1/2" off vertical riser, or 30 degree cant).
;;  Wood nosings are considered as if square (tread level at furthest horizontal projection) for measuring handrail height.
;;  Each step profile in section, and each Public or Accessible handrail profile in plan or section, is a Polyline;
;;    nosing edges in plan, and non-accessible DU handrail profiles in section, are Lines.
;;  Handrail profiles are basic code-minimum extents, for offsetting, filleting, or other adjustment to suit particular cases.
;;  Handrail projections from sides of runs in plan are approximate inboard edges, drawn 3" in; end lengths are code
;;  minimums, with squared returns at ends.  Handrail profiles in section are top edges.
;;  Draws handrails in plan on both sides except in non-accessible Dwelling Units; puts single DU handrail on given
;;  start-point side of single run, or outboard sides of double run.
;;
;;  No options [yet] for more than two runs, two non-parallel runs or non-parallel opposite edges, unequal-width runs in
;;  plan, drawing landing length perpendicular to nosings, rounding nosings on steel/conc steps, drainage sloping of
;;  exterior treads, offsets at landings other than a full tread width, riser profiles other than the two offered, or guards.
;;  NOT for circular stairs, spiral stairs, winders, alternating-tread stairs, or ramps.

Code removed by CAB, use the link to download the copyrighted code.
« Last Edit: January 04, 2015, 01:25:27 PM by CAB »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Lisp in cm or meters for making stairs plan view
« Reply #6 on: January 04, 2015, 07:07:40 PM »
Something simple to get your started.
Should work in CM
« Last Edit: January 05, 2015, 11:38:01 PM by CAB »
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.

diago

  • Guest
Re: Lisp in cm or meters for making stairs plan view
« Reply #7 on: January 05, 2015, 02:39:59 PM »
"STAIR2D" doesn`t work for me on Mac (Autocad 2013 for MAC). This appears on the command line bar:

; error: bad argument type: stringp nil

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Lisp in cm or meters for making stairs plan view
« Reply #8 on: January 05, 2015, 03:26:57 PM »
Sorry about that. Last minute variable name change cause the error.
Download it again & try.

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.

diago

  • Guest
Re: Lisp in cm or meters for making stairs plan view
« Reply #9 on: January 05, 2015, 07:33:23 PM »
I doesn't work yet :(  Now it appears this message :

; error: no function definition: VLAX-GET-ACAD-OBJECT

:(

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2140
  • class keyThumper<T>:ILazy<T>
Re: Lisp in cm or meters for making stairs plan view
« Reply #10 on: January 05, 2015, 08:23:35 PM »
I doesn't work yet :(  Now it appears this message :

; error: no function definition: VLAX-GET-ACAD-OBJECT

:(

I'm out of touch about the MAC.
Does VisualLisp work on the MAC ??
If so, have you loaded the COM interface :
(vl-load-com)

added:
Just checked docs, it should work.
http://knowledge.autodesk.com/support/autocad-for-mac/downloads/caas/documentation/ACD/2014/ENU/files/GUID-53DB599B-641D-45DD-A201-604942A4596C-htm.html
« Last Edit: January 05, 2015, 09:02:59 PM by kdub »
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Lisp in cm or meters for making stairs plan view
« Reply #11 on: January 05, 2015, 11:37:38 PM »
Try again.
I did no load vl-load-com soon enough in the code.

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.

diago

  • Guest
Re: Lisp in cm or meters for making stairs plan view
« Reply #12 on: January 06, 2015, 06:25:08 AM »
Unfortunately I think it is not compatible with Mac, this message appears on the command line bar when I loaded the file successfully:

Command: ; error: vl-load-com not supported on  "Mac OS X Version 10.9 (x86_64)"

..and then when I call the command :

; error: no function definition: VLAX-GET-ACAD-OBJECT

Anyway thanks you all guys ! 
« Last Edit: January 06, 2015, 06:29:06 AM by diago »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Lisp in cm or meters for making stairs plan view
« Reply #13 on: January 06, 2015, 08:51:23 AM »
OK, how about something super simple:
Code: [Select]
(defun c:Stair2D (/ sw td nt sd bp p ang rang lay)
  (setq lay "Stair")
  (if (and (setq sw (getdist "\nEnter stair width: "))  ; Stair Width
           (setq td (getdist "\nEnter stair tread depth:")) ; Tred Depth
           (setq nt (getint "\nEnter number of treads:"))
           (setq bp (getpoint "\nPick base point for stair.")) ; base point
           (setq sd (getpoint bp "\nPick point for direction."))
           )
    (progn
      (setq ang (angle bp sd)
            rang (+ ang (/ pi 2)))
      (entmakex (list '(0 . "LINE") (cons 8 lay) (cons 10 bp) (cons 11 (polar bp ang (* td nt)))))
      (entmakex (list '(0 . "LINE") (cons 8 lay) (cons 10 (setq p (polar bp rang sw))) (cons 11 (polar p ang (* td nt)))))
      (repeat (1+ nt)
        (entmakex (list '(0 . "LINE") (cons 8 lay) (cons 10 bp) (cons 11 p)))
        (setq bp (polar bp ang td)
              p  (polar p  ang td))
      )
    )
  ) ; endif
  (princ)
)
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.

diago

  • Guest
Re: Lisp in cm or meters for making stairs plan view
« Reply #14 on: January 06, 2015, 01:14:55 PM »
Thank you so much CAB !!!!!  It is so simple and it works pretty good !!!!!! and thanks you all guys !!  ^-^

PD. simplest solutions are the Best !!