help fixing my lisp

help fixing my lisp

Anonymous
Not applicable
958 Views
9 Replies
Message 1 of 10

help fixing my lisp

Anonymous
Not applicable

hi everyone,

 

I have a lisp for automatic view-ports, that has been created by someone here, however I need a small adjustment for naming the floor. right now when I use it, it reads 21st to 21th same to 22nd to 22th. 

from 20th floor, all the floors will read it with th.

 

could someone please adjust this to be 21st, 22nd, 23rd same with floor 30s,40s,50s and 60s.

 

thank you in advance,

 

waseem  

0 Likes
Accepted solutions (1)
959 Views
9 Replies
Replies (9)
Message 2 of 10

devitg
Advisor
Advisor

Please upload the sample.dwg where you have to apply such LISP 

0 Likes
Message 3 of 10

Kent1Cooper
Consultant
Consultant

Something like this partial adjustment [untested] ?

(repeat (setq FN (length Ycor)) ;; replacing only the original (repeat) function that starts with this
  (setq
    FY (nth (setq FN (1- FN)) Ycor)
    Fname
      (if (= FN FNT)
        "ROOF" ; then
        (strcat ; else -- numbered floors
          (itoa (1+ FN))
          (cond
            ( (and
                (= (rem FN 10) 0); i.e. (1+ FN) ends in 1
                (/= FN 10); not 11th
              ); and
              "st" ;; [change to "ST" if desired]
            ); end-in-1 condition
            ( (and
                (= (rem FN 10) 1); i.e. (1+ FN) ends in 2
                (/= FN 11); not 12th
              ); and
              "nd" ;; [change to "ND" if desired]
            ); end-in-2 condition
            ( (and
                (= (rem FN 10) 2); i.e. (1+ FN) ends in 3
                (/= FN 12); not 13th
              ); and
              "rd" ;; [change to "RD" if desired]
            ); end-in-3 condition
            ("th"); none-of-the-above -- all others [to "TH" if desired]
          ); cond
          " FLOOR"
        ); strcat
      ); if & Fname
    Fname_lst (cons (list FY Fname) Fname_lst))
  ); setq
); repeat

 

Kent Cooper, AIA
0 Likes
Message 4 of 10

Anonymous
Not applicable

@Kent1Cooperdidn't work, could you please upload into a lisp file so I can test it again

0 Likes
Message 5 of 10

Kent1Cooper
Consultant
Consultant

If you simply may not have replaced the right lines, I tried -- lines 50 through 62 in the original are replaced by lines 50 through 84 in the attached.  I did not test it.

Kent Cooper, AIA
0 Likes
Message 6 of 10

Anonymous
Not applicable

@Kent1Cooperstill there's an error when I test it. I might upload the video of my drawings so you can have an idea of how this lisp works. thanks

0 Likes
Message 7 of 10

hak_vz
Advisor
Advisor

Try code in attachment.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 8 of 10

Anonymous
Not applicable

@hak_vzhi, lisp file still not accurate, please see attached Cad file. 

once you appload the file, you just need to select the box to create view-ports for you.

however last floor should be roof and that's ok, but if you notice it'll create you 21th floor and 21st floor.

 

please don't change the way it is, the x and y, I just need an adjustment for the floors so it reads probably.

 

regards,

 

Waseem

0 Likes
Message 9 of 10

Kent1Cooper
Consultant
Consultant
Accepted solution

My error....

 

This line:

Fname_lst (cons (list FY Fname) Fname_lst))

has an extra right parenthesis.  Change that to:

Fname_lst (cons (list FY Fname) Fname_lst)

 and try again.

Kent Cooper, AIA
0 Likes
Message 10 of 10

Anonymous
Not applicable

@Kent1Cooperworks perfect, thanks

0 Likes