乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 20|回复: 10

[编程交流] Stair section LISP - Help!

[复制链接]

5

主题

34

帖子

29

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-5 18:05:29 | 显示全部楼层 |阅读模式
Hi everyone,
 
I found this great and simple LISP for stair section. I wanted to add a few more options to this LISP which it won't currently let you do. Firstly I want to specify the tread width since the default is set to 11. I've managed to create a prompt for the width, but it leaves a a gap if you chose anything other than 11". Also, I'd like to be able to set a starting point for the stairs and set the max riser on it. Any thoughts?
 
Thank you.
 
  1. (defun C:STAIRPROFILE (/            ANG                 CNT               ELEVDIFF            LOWER         LOWERFLOOR               LOWERFLOORPICK                 OSM               PNTARRAY            RISERHEIGHT         STARTPNT               UPPER            UPPERFLOOR         UPPERFLOORPICK               PROBLEM              ) (setq OSM (getvar "OSMODE")) (setvar "osmode" 0) (defun ASC (ELEMENT ENTITY /) (cdr (assoc ELEMENT ENTITY)));;; retrieve assoc data from entity (defun DTR (A) (* pi (/ A 180.0)));;; utility to convert decimal degrees to radians(setq        TREADWIDTH (getdist "\nWhat tread width?: ")LOWERFLOOR (entsel "\nSelect lower floor: ")LOWERFLOORPICK (car (cdr LOWERFLOOR))LOWERFLOOR (entget (car LOWERFLOOR))UPPERFLOOR (entsel "\nSelect upper floor: ")UPPERFLOORPICK (car (cdr UPPERFLOOR))UPPERFLOOR (entget (car UPPERFLOOR))PROBLEM        0 ) (if (= (ASC 0 LOWERFLOOR) "LINE")   (if        (= (cadr (ASC 10 LOWERFLOOR)) (cadr (ASC 11 LOWERFLOOR)))     (setq LOWER (cadr (ASC 10 LOWERFLOOR)))     (setq PROBLEM 1)   )   (setq PROBLEM 2) ) (if (= (ASC 0 UPPERFLOOR) "LINE")   (if        (= (cadr (ASC 10 UPPERFLOOR)) (cadr (ASC 11 UPPERFLOOR)))     (setq UPPER (cadr (ASC 10 UPPERFLOOR)))     (setq PROBLEM 3)   )   (setq PROBLEM 4) ) (if (and (/= UPPER NIL) (/= LOWER NIL) (/= PROBLEM 1))   (progn     (if (> UPPER LOWER)(progn  (setq ELEVDIFF (- UPPER LOWER)))(progn (setq ELEVDIFF (- LOWER UPPER)))     )     (setq RISERHEIGHT        (/ ELEVDIFF (fix (/ ELEVDIFF 7)))    STARTPNT        (inters        (ASC 10 LOWERFLOOR)                        (ASC 11 LOWERFLOOR)                        LOWERFLOORPICK                        (polar LOWERFLOORPICK (DTR 90.0) 1.0)                        NIL                )     )     (if (> (car UPPERFLOORPICK) (car STARTPNT))(setq ANG (DTR 0.0))(setq ANG (DTR 180.0))     )     (setq PNTARRAY NIL)     (repeat (fix (/ ELEVDIFF RISERHEIGHT))(if (not PNTARRAY)  (setq        PNTARRAY         (list (polar (polar STARTPNT (DTR 90.0) RISERHEIGHT)                      ANG                      10.0               )         )  )  (setq        PNTARRAY         (append           (list (polar        (polar (car PNTARRAY) (DTR 90.0) RISERHEIGHT)                        ANG                        10.0                 )           )           PNTARRAY         )  ))     )     (setq PNTARRAY (append (list STARTPNT) (reverse PNTARRAY)))     (setq CNT 0)     (repeat (1- (length PNTARRAY))(CREATETREAD (nth CNT PNTARRAY) RISERHEIGHT ANG)(setq CNT (1+ CNT))     )   )   (progn (cond     ((= PROBLEM 1)      (setq MSG "Lower elevation not level.")     )     ((= PROBLEM 2)      (setq MSG        (strcat        "Lower level not of type "                        (chr 34)                        "LINE"                        (chr 34)                        "."                )      )     )     ((= PROBLEM 3)      (setq MSG "Upper elevation not level.")     )     ((= PROBLEM 4)      (setq MSG        (strcat        "Upper level not of type "                        (chr 34)                        "LINE"                        (chr 34)                        "."                )      )     )   )   (alert MSG)   ) ) (setvar "osmode" OSM))(defun CREATETREAD (N HEIGHT ANG /) (setq        TREADHEIGHT         1.5NOSEWIDTH 1.0 ) (setq        TREADPNTS (list (polar N (DTR 90.0) (- HEIGHT TREADHEIGHT)))TREADPNTS (append            (list              (polar (car TREADPNTS) (+ (DTR 180.0) ANG) NOSEWIDTH)            )            TREADPNTS          )TREADPNTS (append            (list (polar (car TREADPNTS) (DTR 90.0) TREADHEIGHT))            TREADPNTS          )TREADPNTS (append (list (polar (car TREADPNTS) ANG TREADWIDTH))                  TREADPNTS          )TREADPNTS (reverse TREADPNTS) ) (command "line"   N   (nth 0 TREADPNTS)   (nth 1 TREADPNTS)   (nth 2 TREADPNTS)   (nth 3 TREADPNTS)   "" ))
回复

使用道具 举报

5

主题

34

帖子

29

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-5 18:15:49 | 显示全部楼层
Ok i've made a bit or progress... But I still can't figure out why any value above or below 11 messes up how the stairs are assembled. I either end up getting gaps or overlaps.
 
  1. (defun C:dsp (/            ANG                 CNT               ELEVDIFF            LOWER         LOWERFLOOR               LOWERFLOORPICK                 OSM               PNTARRAY            RISERHEIGHT         STARTPNT               UPPER            UPPERFLOOR         UPPERFLOORPICK               PROBLEM              ) (setq OSM (getvar "OSMODE")) (setvar "osmode" 0) (defun ASC (ELEMENT ENTITY /) (cdr (assoc ELEMENT ENTITY)));;; retrieve assoc data from entity (defun DTR (A) (* pi (/ A 180.0)));;; utility to convert decimal degrees to radians(setq        TREADWIDTH (getdist "\nWhat tread width?: ")LOWERFLOOR (entsel "\nSelect lower floor: ")LOWERFLOORPICK (car (cdr LOWERFLOOR))LOWERFLOOR (entget (car LOWERFLOOR))UPPERFLOOR (entsel "\nSelect upper floor: ")UPPERFLOORPICK (car (cdr UPPERFLOOR))UPPERFLOOR (entget (car UPPERFLOOR))PROBLEM        0 ) (if (= (ASC 0 LOWERFLOOR) "LINE")   (if        (= (cadr (ASC 10 LOWERFLOOR)) (cadr (ASC 11 LOWERFLOOR)))     (setq LOWER (cadr (ASC 10 LOWERFLOOR)))     (setq PROBLEM 1)   )   (setq PROBLEM 2) ) (if (= (ASC 0 UPPERFLOOR) "LINE")   (if        (= (cadr (ASC 10 UPPERFLOOR)) (cadr (ASC 11 UPPERFLOOR)))     (setq UPPER (cadr (ASC 10 UPPERFLOOR)))     (setq PROBLEM 3)   )   (setq PROBLEM 4) ) (if (and (/= UPPER NIL) (/= LOWER NIL) (/= PROBLEM 1))   (progn     (if (> UPPER LOWER)(progn  (setq ELEVDIFF (- UPPER LOWER)))(progn (setq ELEVDIFF (- LOWER UPPER)))     )          (setq N (/ ELEVDIFF 7.75))     (setq RISERHEIGHT        (/ ELEVDIFF (fix (+ N(if (minusp N) -0.5 0.5))))    STARTPNT        (inters        (ASC 10 LOWERFLOOR)                        (ASC 11 LOWERFLOOR)                        LOWERFLOORPICK                        (polar LOWERFLOORPICK (DTR 90.0) 1.0)                        NIL                )     )     (if (> (car UPPERFLOORPICK) (car STARTPNT))(setq ANG (DTR 0.0))(setq ANG (DTR 180.0))     )     (setq PNTARRAY NIL)     (repeat (fix (/ ELEVDIFF RISERHEIGHT))(if (not PNTARRAY)  (setq        PNTARRAY         (list (polar (polar STARTPNT (DTR 90.0) RISERHEIGHT)                      ANG                      10.0               )         )  )  (setq        PNTARRAY         (append           (list (polar        (polar (car PNTARRAY) (DTR 90.0) RISERHEIGHT)                        ANG                        10.0                 )           )           PNTARRAY         )  ))     )     (setq PNTARRAY (append (list STARTPNT) (reverse PNTARRAY)))     (setq CNT 0)     (repeat (1- (length PNTARRAY))(CREATETREAD (nth CNT PNTARRAY) RISERHEIGHT ANG)(setq CNT (1+ CNT))     )   )   (progn (cond     ((= PROBLEM 1)      (setq MSG "Lower elevation not level.")     )     ((= PROBLEM 2)      (setq MSG        (strcat        "Lower level not of type "                        (chr 34)                        "LINE"                        (chr 34)                        "."                )      )     )     ((= PROBLEM 3)      (setq MSG "Upper elevation not level.")     )     ((= PROBLEM 4)      (setq MSG        (strcat        "Upper level not of type "                        (chr 34)                        "LINE"                        (chr 34)                        "."                )      )     )   )   (alert MSG)   ) ) (setvar "osmode" OSM))(defun CREATETREAD (N HEIGHT ANG /) (setq        TREADHEIGHT         1.5NOSEWIDTH 1.0 ) (setq        TREADPNTS (list (polar N (DTR 90.0) (- HEIGHT TREADHEIGHT)))TREADPNTS (append            (list              (polar (car TREADPNTS) (+ (DTR 180.0) ANG) NOSEWIDTH)            )            TREADPNTS          )TREADPNTS (append            (list (polar (car TREADPNTS) (DTR 90.0) TREADHEIGHT))            TREADPNTS          )TREADPNTS (append (list (polar (car TREADPNTS) ANG TREADWIDTH))                  TREADPNTS          )TREADPNTS (reverse TREADPNTS) ) (command "line"   N   (nth 0 TREADPNTS)   (nth 1 TREADPNTS)   (nth 2 TREADPNTS)   (nth 3 TREADPNTS)   "" ))
回复

使用道具 举报

BKT

1

主题

124

帖子

123

银币

初来乍到

Rank: 1

铜币
7
发表于 2022-7-5 18:19:05 | 显示全部楼层
I'm only looking at what makes the tread 11" wide here.
 
Where you set the variable PNTARRAY to a list in two places, change the entry "10.0" to your variable TREADWIDTH minus 1.0 (- TREADWIDTH 1.0) which I think is your NOSEWIDTH, but that's not set until later in your code.  Since it's hard-coded anyway, that's what I did to get it to work...
 
Or, you could just rearrange the code to call the NOSEWIDTH so you could subtract it from the TREADWIDTH.
 
  1. (list (polar (polar (car PNTARRAY) (DTR 90.0) RISERHEIGHT)            ANG            [color=red]10.0 ; make this (- TREADWIDTH 1.0)[/color]     ))
回复

使用道具 举报

5

主题

34

帖子

29

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-5 18:25:03 | 显示全部楼层
 
Thank you! This works perfectly. Any thoughts on how to be able to chose a point in which to start the stairs? I thought about changing the (entsel) to (getpoint) but when I changed it, it didn't work. So i'm a bit over my head with it.
回复

使用道具 举报

BKT

1

主题

124

帖子

123

银币

初来乍到

Rank: 1

铜币
7
发表于 2022-7-5 18:35:06 | 显示全部楼层
Start by moving the (setvar "osmode" 0) below the floor variables...
 
  1. (setq OSM (getvar "OSMODE")) (setvar "osmode" 0) [color=red]; move from here...[/color] (defun ASC (ELEMENT ENTITY /) (cdr (assoc ELEMENT ENTITY)));;; retrieve assoc data from entity (defun DTR (A) (* pi (/ A 180.0)));;; utility to convert decimal degrees to radians(setq       TREADWIDTH    (getdist "\nWhat tread width?: ")   LOWERFLOOR    (entsel "\nSelect lower floor: ")   LOWERFLOORPICK    (car (cdr LOWERFLOOR))   LOWERFLOOR    (entget (car LOWERFLOOR))   UPPERFLOOR    (entsel "\nSelect upper floor: ")   UPPERFLOORPICK    (car (cdr UPPERFLOOR))   UPPERFLOOR    (entget (car UPPERFLOOR))   PROBLEM    0 ) (setvar "osmode" 0) [color=red]; to here[/color]
1. Change LOWERFLOOR using GETPOINT, as you mentioned, but add NENTSELP
 
   (nentselp (getpoint "\nSelect lower floor: "))
 
2. Change LOWERFLOORPICK to select the entity GETPOINT location
 
   (cadr LOWERFLOOR)
 
  1. (setq       TREADWIDTH    (getdist "\nWhat tread width?: ")   LOWERFLOOR    (entsel "\nSelect lower floor: ") [color=red]; here...[/color]   LOWERFLOORPICK    (car (cdr LOWERFLOOR)) [color=red]; here...[/color]   LOWERFLOOR    (entget (car LOWERFLOOR))   UPPERFLOOR    (entsel "\nSelect upper floor: ")   UPPERFLOORPICK    (car (cdr UPPERFLOOR))   UPPERFLOOR    (entget (car UPPERFLOOR))   PROBLEM    0 )
See if that helps.
回复

使用道具 举报

5

主题

34

帖子

29

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-5 18:39:39 | 显示全部楼层
 
I tried what you said but I would get an error saying the selection is not a "LINE" before the program even starts running then it gives me an error.
 
I did a crappy work around by doing this. Notice i also fixed my round up issue.
 
  1. (defun C:dss (/            ANG                 CNT               ELEVDIFF            LOWER         LOWERFLOOR               LOWERFLOORPICK                 OSM               PNTARRAY            RISERHEIGHT         STARTPNT               UPPER            UPPERFLOOR         UPPERFLOORPICK               PROBLEM              ) (setq OSM (getvar "OSMODE")) (setvar "osmode" 0) (defun ASC (ELEMENT ENTITY /) (cdr (assoc ELEMENT ENTITY)));;; retrieve assoc data from entity (defun DTR (A) (* pi (/ A 180.0)));;; utility to convert decimal degrees to radians(setq        TREADWIDTH (getdist "\nWhat is tread width including nosing?: ")LOWERFLOOR (entsel "\nSelect lower floor: ")LOWERFLOORPICK (car (cdr LOWERFLOOR))LOWERFLOOR (entget (car LOWERFLOOR))UPPERFLOOR (entsel "\nSelect upper floor: ")UPPERFLOORPICK (car (cdr UPPERFLOOR))UPPERFLOOR (entget (car UPPERFLOOR))PROBLEM        0 ) (if (= (ASC 0 LOWERFLOOR) "LINE")   (if        (= (cadr (ASC 10 LOWERFLOOR)) (cadr (ASC 11 LOWERFLOOR)))     (setq LOWER (cadr (ASC 10 LOWERFLOOR)))     (setq PROBLEM 1)   )   (setq PROBLEM 2) ) (if (= (ASC 0 UPPERFLOOR) "LINE")   (if        (= (cadr (ASC 10 UPPERFLOOR)) (cadr (ASC 11 UPPERFLOOR)))     (setq UPPER (cadr (ASC 10 UPPERFLOOR)))     (setq PROBLEM 3)   )   (setq PROBLEM 4) ) (if (and (/= UPPER NIL) (/= LOWER NIL) (/= PROBLEM 1))   (progn     (if (> UPPER LOWER)(progn  (setq ELEVDIFF (- UPPER LOWER)))(progn (setq ELEVDIFF (- LOWER UPPER)))     )          (setq N (/ ELEVDIFF 7.75))(defun ROUND ( n m )   (cond       ((equal 0.0 (rem n m) 1e- n)       ((< n 0) (- n (rem n m)))       ((+ n (- m (rem n m))))   ))(setq B (ROUND N 1))(setvar "osmode" 3)     (setq RISERHEIGHT        (/ ELEVDIFF B)    STARTPNT                (getpoint "\nPick starting point: "))(setvar "osmode" 0)     (setq ans (getstring "\nIs stair going left or right bound? L/R  "))  (if (= (strcase ans) "R")(setq ANG (DTR 0.0))(setq ANG (DTR 180.0))     )     (setq PNTARRAY NIL)     (repeat (fix (/ ELEVDIFF RISERHEIGHT))(if (not PNTARRAY)  (setq        PNTARRAY         (list (polar (polar STARTPNT (DTR 90.0) RISERHEIGHT)                      ANG                      (- TREADWIDTH 1.0)               )         )  )  (setq        PNTARRAY         (append           (list (polar        (polar (car PNTARRAY) (DTR 90.0) RISERHEIGHT)                        ANG                        (- TREADWIDTH 1.0)                 )           )           PNTARRAY         )  ))     )     (setq PNTARRAY (append (list STARTPNT) (reverse PNTARRAY)))     (setq CNT 0)     (repeat (1- (length PNTARRAY))(CREATETREAD (nth CNT PNTARRAY) RISERHEIGHT ANG)(setq CNT (1+ CNT))     )   )   (progn (cond     ((= PROBLEM 1)      (setq MSG "Lower elevation not level.")     )     ((= PROBLEM 2)      (setq MSG        (strcat        "Lower level not of type "                        (chr 34)                        "LINE"                        (chr 34)                        "."                )      )     )     ((= PROBLEM 3)      (setq MSG "Upper elevation not level.")     )     ((= PROBLEM 4)      (setq MSG        (strcat        "Upper level not of type "                        (chr 34)                        "LINE"                        (chr 34)                        "."                )      )     )   )   (alert MSG)   ) ) (setvar "osmode" OSM))(defun CREATETREAD (N HEIGHT ANG /) (setq        TREADHEIGHT         1.5NOSEWIDTH 1.0 ) (setq        TREADPNTS (list (polar N (DTR 90.0) (- HEIGHT TREADHEIGHT)))TREADPNTS (append            (list              (polar (car TREADPNTS) (+ (DTR 180.0) ANG) NOSEWIDTH)            )            TREADPNTS          )TREADPNTS (append            (list (polar (car TREADPNTS) (DTR 90.0) TREADHEIGHT))            TREADPNTS          )TREADPNTS (append (list (polar (car TREADPNTS) ANG TREADWIDTH))                  TREADPNTS          )TREADPNTS (reverse TREADPNTS) ) (command "line"   N   (nth 0 TREADPNTS)   (nth 1 TREADPNTS)   (nth 2 TREADPNTS)   (nth 3 TREADPNTS)   "" ))(defun *error* (msg)(cond ((not msg)) ; Normal exit((member msg '("Function cancelled" "quit / exit abort"))) ;  or (quit)((princ (strcat "\n  Error: " msg "  ")) ; Fatal error, display it(cond ((vl-bb-ref '*Debug*) (vl-bt))))) ; If in debug mode, dump backtrace(setvar 'OSMODE OSM) (princ))
回复

使用道具 举报

BKT

1

主题

124

帖子

123

银币

初来乍到

Rank: 1

铜币
7
发表于 2022-7-5 18:44:17 | 显示全部楼层
Huh...  not sure what went wrong - it works for me in BricsCAD, but I'm glad you got it to work!
回复

使用道具 举报

5

主题

34

帖子

29

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-5 18:48:33 | 显示全部楼层
 
 
From what I can tell, this is causing the issue.
 
  1. (if (= (ASC 0 LOWERFLOOR) "LINE")   (if        (= (cadr (ASC 10 LOWERFLOOR)) (cadr (ASC 11 LOWERFLOOR)))     (setq LOWER (cadr (ASC 10 LOWERFLOOR)))     (setq PROBLEM 1)   )   (setq PROBLEM 2) ) (if (= (ASC 0 UPPERFLOOR) "LINE")   (if        (= (cadr (ASC 10 UPPERFLOOR)) (cadr (ASC 11 UPPERFLOOR)))     (setq UPPER (cadr (ASC 10 UPPERFLOOR)))     (setq PROBLEM 3)
 
  1. ((= PROBLEM 2)      (setq MSG        (strcat        "Lower level not of type "                        (chr 34)
 
 
I tried deleting the PROBLEMs but it was giving me trouble. So i don't know. What I have isn't glorious but its working for the time being. Unless someone is kind enough to rewrite it anyways
回复

使用道具 举报

BKT

1

主题

124

帖子

123

银币

初来乍到

Rank: 1

铜币
7
发表于 2022-7-5 18:56:08 | 显示全部楼层
Just checkin' with you - both of the lines you're selecting are LINES and not PLINES, right?  Weird...
回复

使用道具 举报

5

主题

34

帖子

29

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-5 19:02:40 | 显示全部楼层
 
Yes. Infact, this error popped up before I could even select anything. However, I do think I did something wrong.
 
So here's the code I think we have in similar. This is not the latest and greatest, but more likely the one with have in common
 
 
  1. (defun C:DSP (/            ANG                 CNT               ELEVDIFF            LOWER         LOWERFLOOR               LOWERFLOORPICK                 OSM               PNTARRAY            RISERHEIGHT         STARTPNT               UPPER            UPPERFLOOR         UPPERFLOORPICK               PROBLEM              ) (setq OSM (getvar "OSMODE")) (defun ASC (ELEMENT ENTITY /) (cdr (assoc ELEMENT ENTITY)));;; retrieve assoc data from entity (defun DTR (A) (* pi (/ A 180.0)));;; utility to convert decimal degrees to radians(setq        TREADWIDTH (getdist "\nWhat tread width?: ")LOWERFLOOR (nentselp (getpoint "\nSelect lower floor: "))LOWERFLOORPICK (car (cdr LOWERFLOOR))LOWERFLOOR (nentselp (cadr LOWERFLOOR))UPPERFLOOR (entsel "\nSelect upper floor: ")UPPERFLOORPICK (car (cdr UPPERFLOOR))UPPERFLOOR (entget (car UPPERFLOOR))PROBLEM        0 ) (setvar "osmode" 0) (if (= (ASC 0 LOWERFLOOR) "LINE")   (if        (= (cadr (ASC 10 LOWERFLOOR)) (cadr (ASC 11 LOWERFLOOR)))     (setq LOWER (cadr (ASC 10 LOWERFLOOR)))     (setq PROBLEM 1)   )   (setq PROBLEM 2) ) (if (= (ASC 0 UPPERFLOOR) "LINE")   (if        (= (cadr (ASC 10 UPPERFLOOR)) (cadr (ASC 11 UPPERFLOOR)))     (setq UPPER (cadr (ASC 10 UPPERFLOOR)))     (setq PROBLEM 3)   )   (setq PROBLEM 4) ) (if (and (/= UPPER NIL) (/= LOWER NIL) (/= PROBLEM 1))   (progn     (if (> UPPER LOWER)(progn  (setq ELEVDIFF (- UPPER LOWER)))(progn (setq ELEVDIFF (- LOWER UPPER)))     )          (setq N (/ ELEVDIFF 7.75))     (setq RISERHEIGHT        (/ ELEVDIFF (fix (+ N(if (minusp N) -0.5 0.5))))    STARTPNT        (inters        (ASC 10 LOWERFLOOR)                        (ASC 11 LOWERFLOOR)                        LOWERFLOORPICK                        (polar LOWERFLOORPICK (DTR 90.0) 1.0)                        NIL                )     )     (if (> (car UPPERFLOORPICK) (car STARTPNT))(setq ANG (DTR 0.0))(setq ANG (DTR 180.0))     )     (setq PNTARRAY NIL)     (repeat (fix (/ ELEVDIFF RISERHEIGHT))(if (not PNTARRAY)  (setq        PNTARRAY         (list (polar (polar STARTPNT (DTR 90.0) RISERHEIGHT)                      ANG                      10.0               )         )  )  (setq        PNTARRAY         (append           (list (polar        (polar (car PNTARRAY) (DTR 90.0) RISERHEIGHT)                        ANG                        10.0                 )           )           PNTARRAY         )  ))     )     (setq PNTARRAY (append (list STARTPNT) (reverse PNTARRAY)))     (setq CNT 0)     (repeat (1- (length PNTARRAY))(CREATETREAD (nth CNT PNTARRAY) RISERHEIGHT ANG)(setq CNT (1+ CNT))     )   )   (progn (cond     ((= PROBLEM 1)      (setq MSG "Lower elevation not level.")     )     ((= PROBLEM 2)      (setq MSG        (strcat        "Lower level not of type "                        (chr 34)                        "LINE"                        (chr 34)                        "."                )      )     )     ((= PROBLEM 3)      (setq MSG "Upper elevation not level.")     )     ((= PROBLEM 4)      (setq MSG        (strcat        "Upper level not of type "                        (chr 34)                        "LINE"                        (chr 34)                        "."                )      )     )   )   (alert MSG)   ) ) (setvar "osmode" OSM))(defun CREATETREAD (N HEIGHT ANG /) (setq        TREADHEIGHT         1.5NOSEWIDTH 1.0 ) (setq        TREADPNTS (list (polar N (DTR 90.0) (- HEIGHT TREADHEIGHT)))TREADPNTS (append            (list              (polar (car TREADPNTS) (+ (DTR 180.0) ANG) NOSEWIDTH)            )            TREADPNTS          )TREADPNTS (append            (list (polar (car TREADPNTS) (DTR 90.0) TREADHEIGHT))            TREADPNTS          )TREADPNTS (append (list (polar (car TREADPNTS) ANG TREADWIDTH))                  TREADPNTS          )TREADPNTS (reverse TREADPNTS) ) (command "line"   N   (nth 0 TREADPNTS)   (nth 1 TREADPNTS)   (nth 2 TREADPNTS)   (nth 3 TREADPNTS)   "" ))
 
 
With this code I get the following error after I select the ground floor point:
 
Select upper floor:
  Error: bad association list: ( (2180.67 -22506.0 0.0))
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-13 00:56 , Processed in 0.736802 second(s), 72 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表