Jump to content

LISP and Building Code charts


Strydaris

Recommended Posts

Hey everyone,

I'm still a little green when it comes to writing LISP.

Was hoping to get some advice / help here with a little LISP I'd like to put together, but I'm unsure on the best method to do what I want to do.

I work mostly with residential housing and I am looking to put together a lisp that can size my wood window/door headers and steel lintels based on the charts inside my local building code.

The idea of how I would like to run the lisp is:

1. tell the lisp what my specified snow load is for the project and keep this as a ask once question and skip it the next time I run the routine in the current session.
2. ask what the lintel is supporting. ie. Roof and ceiling only or 2 Storeys + Roof and ceiling only etc.
3. pick one side of the window opening, then pick the second side to get the distance.
4. ask if the is brick to support (So the lisp know whether or not to input the steel lintel info).
5. pick the rotation of the text to input.

Based on all this info, I was wondering what the best course of action would be to pull the information for the Building Code charts into the lisp for use.
I found an older Lisp that used the max spans of the wood headers to determine the size to be input into the drawing using COND statements. With this method it seems I would have to write a setq for every max span for every snowload. Part of the code looks something like this:
(IF (/= DIST NIL)
    (COND
      ((AND (> DIST 0) (<= DIST 2X6MAXSPAN))
       (COMMAND "-LAYER" "S" (strcat flworkly "STRUCT") "")
       (COMMAND "TEXT" "J" "BC" MIDDLE 4 DEGREES2 (STRCAT "2-2X6" STEEL))
      )
               ;END FIRST CONDITION

      ((AND (> DIST 2X6MAXSPAN) (<= DIST 2X8MAXSPAN))
       (COMMAND "-LAYER" "S" (strcat flworkly "STRUCT") "")
       (COMMAND "TEXT" "J" "BC" MIDDLE 4 DEGREES2 (STRCAT "2-2X8" STEEL))
      )
     
               ;END SECOND CONDITION
I'm just not sold on the idea that this is the best way to do it and it seems like a very inefficient way to do it.
I hope I explained this well enough.

Anyone have any ideas?
Thanks.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...