Can I use a lisp to take an Excel file and create a floor plan?

Can I use a lisp to take an Excel file and create a floor plan?

tbrown
Participant Participant
1,744 Views
13 Replies
Message 1 of 14

Can I use a lisp to take an Excel file and create a floor plan?

tbrown
Participant
Participant

My ultimate goal is to have an excel file that has all the parameters of the building (length, width, height, pitch, door locations, window locations, overhang etc,).  I am looking at how I can create a lisp to do this for me. I am an amateur to this side of AutoCAD but am willing to learn. Where can I go to get the right information or the right path. If anyone has already done this before, where can I go to get that lisp? Attached is something I would want the lisp to be able to generate. 

 

Thanks for any direction or help with this topic!

0 Likes
1,745 Views
13 Replies
Replies (13)
Message 2 of 14

Kent1Cooper
Consultant
Consultant

[Nothing attached]

Kent Cooper, AIA
0 Likes
Message 3 of 14

tbrown
Participant
Participant

Sorry about that. Thought it was attached. Lets try again. Attached to this reply.

0 Likes
Message 4 of 14

pendean
Community Legend
Community Legend

@tbrown wrote:

Sorry about that. Thought it was attached. Lets try again. Attached to this reply.


That's a PDF, where is the XLS file?

0 Likes
Message 5 of 14

CodeDing
Advisor
Advisor

@tbrown ,

 

I'm sure it would be possible to automate much (if not all) of your process via Lisp.. But the hard part is having all of the information necessary to automate it!

 

It sounds like you do not have an excel file yet, if that is the case then I would recommend that you start there. Because once you have the Excel file (with all necessary building information), then it would be possible (not necessarily easy) to automate your process with lisp.

 

Questions like this have been asked hundreds/thousands of times (though you won't see them on the forums if they're 10+ years old), but each case is unique and probably does not apply broadly. That is the trouble you will have with this task. You will need to create a solution that is tailored to your specific data, layout, and desired finished product.

 

Best,

~DD

Message 6 of 14

ec-cad
Collaborator
Collaborator

Hmm,

Let's take just (1) case, partial job, say "LEFT END ELEVATION" image.

Excel file would have to include (2) X,Y points for each Line (quick count of about 80).

And a block set with that door / window, perhaps the garage door, konch light.

And a line in excel for each blockname / insertion point at a minumum.

For the Walters Steel Wainscot Panels, maybe 'array, with 2 lines, 6 points.. etc. along

with 'trim' for roof angle.. Not to forget the Leaders, Dim's..

Basically, by the time you code the Lisp, make up a unique excel (not reusable) file,

you and I will both be retired.

🙂

ECCAD

0 Likes
Message 7 of 14

Kent1Cooper
Consultant
Consultant

Why Excel, if I may ask?  There's already a file format "that has all the parameters of the building" -- .DWG.  What can putting any of that into a spreadsheet format do for you?  And where is such an Excel file coming from?  How is it getting the parameters put into it?  How does it store them?


Kent Cooper, AIA
0 Likes
Message 8 of 14

tbrown
Participant
Participant

This is the excel file. The reason excel would be the best format is, it is already being used by another department and would keep all information as one streamline.

0 Likes
Message 9 of 14

tbrown
Participant
Participant
I will add that these two files are not the same project. I am just trying to get something started to know my capabilities. There is much more information that is filed than what is included in the above file, but I'm willing to start with just a basic shell of a building and then I can revamp the code from there. As long as I am understanding this correctly.
0 Likes
Message 10 of 14

-didier-
Advisor
Advisor

Bonjour @tbrown 

 

You do not have enough information in the xls file to draw what is on the pdf.

It really lacks a lot, position, and width and height of the door, width of the rooms, thickness of the roof...

 

It is interesting as question, but the lack of information are too many.

 

Amicalement

Éternel débutant.. my site for learning : Programmer dans AutoCAD

DA

EESignature

0 Likes
Message 11 of 14

CodeDing
Advisor
Advisor

@tbrown ,

 

Thank you for providing PDF & Excel. Now to remind you of what I said earlier:

 


@CodeDing wrote:
...then it would be possible (not necessarily easy) to automate...

So now you have to read the Excel file, then use your inputs to create useful items within AutoCAD.

Here's some code (GetExcel.lsp) to read an Excel file:

https://www.autolisp-exchange.com/LISP/GetExcel.lsp 

 

Then, to create entities within AutoCAD will just take practice if you're not familiar. My suggestions:

- Create as many useful Blocks as possible first and add them to your template.

- Then, perhaps look into useful resources like:

--- AutoLisp Documentation: https://help.autodesk.com/view/OARX/2025/ENU/?guid=GUID-4CEE5072-8817-4920-8A2D-7060F5E16547 

--- Afralisp Tutorials: https://www.afralisp.net/autolisp/tutorials/index.php?category_id=1 

 

If you get stuck on particular steps of your process, and unable to overcome them with research, then come back to the forums and ask for help to keep you moving forward.

 

If you desire someone to create this project for you, then just be blunt and make that known so people know how to best help you.

 

Best,

~DD

0 Likes
Message 12 of 14

tbrown
Participant
Participant

Thank you for the resources. I will read up on all of it.

 

I definitely want to learn and gain the skills but am not opposed to having somebody to do this for me either.

 

If somebody would like to do this for me I can get you much more organized files with my templates and blocks needed to do it. 

 

Please contact me if that is something you are interested in.

Message 13 of 14

Kent1Cooper
Consultant
Consultant

Wow....  Even for just the simple shell part, with only the little information in that file, first of all the .xlsx file needs to be converted to .csv format so AutoLisp's (open) and (read-line) functions can pull information from it.  Then once we get past the heading lines to the "meat" of it, I think at the very least some aspects of the content would need to be formatted differently.  For example, here are the first few lines of real content, as pulled by (read-line):

 

",Grade to Heel (GTH):,12,FT,148,IN,"
",,4,IN,,,"
",Heel Height:,14,IN,,,"
",Purlin Height:,3.5,IN,,,"
",Purlin Spacing:,24,IN,,,"
",Top Chord Pitch:,4,/12,,,"
",Bottom Chord Pitch:,0,/12,,,"
",Building Width:,42,FT,504,IN,"
",,0,IN,,,"

 

Assuming a working around the comma cell separators, and defining what to ignore like the "IN" parts, note that certain relevant content is not even contained within a single line -- the feet and the inches in red go together.  [In the later case with zero inches, the first line would be enough, but that can't be assumed.]  If set it up to ignore the FT part and use only the IN number after that on the same line, somehow it would need to be instructed to completely ignore the next line it reads, but not all such dimensions are on two lines like those.  But the Column Spacing numbers go beyond that, to have a redundancy on the number of feet on the same line as the number of inches.

 

And other things occur to me, not about the extracting information to draw with, but about the information itself.  The building is 42' wide, and the end column spacing is 7'.  If that 42' is [as would be typical] an exterior dimension, at least the end bays of the column spacing [which would typically be a center-to-center dimension] would need to be less than 7'.  Likewise with the Building Length and the Sidewall Column spacing.

 

And even after getting relevant information in some usable way, there could be big complications about [for example] where to draw a given Line that it has determined needs to be drawn.  Maybe that would be manageable if there's something close to constant about the range of possibilities.

 

It all seems very daunting to me.  But at least I would want to start from a file with information formatted in a way that is conscious of how AutoCAD needs it.

Kent Cooper, AIA
0 Likes
Message 14 of 14

Sea-Haven
Mentor
Mentor

Sorry Kent "as pulled by (read-line):" no need just read Excel direct can look at any cell I have read the 1st and last cell no user input, so all parameters are within that range, the 1st step though would be work from outside to in, rearrange the sequence the 1st two rows should be length and width. Then Roof etc, then doors, then whatever. 

 

It looks like a commercial style building with say steel columns and rafters. 

 

For me @tbrown look at this movie of a task it would be easier to just start again, manually a person reading the excel for a start and just filling in questions. 

Starting with something like this just add more options. This dcl took like 2 minutes to make.

SeaHaven_0-1734577813502.pngSeaHaven_1-1734578301302.png

 

Please be aware the movie project was a paid for project. This is a package yes it has a cost. But its answer questions and object is drawn

SeaHaven_2-1734578475151.png

 

0 Likes