Create dynamic blocks using an excel list

Create dynamic blocks using an excel list

Anonymous
Not applicable
803 Views
5 Replies
Message 1 of 6

Create dynamic blocks using an excel list

Anonymous
Not applicable

Hi all,

is there a way how I can automatically generate dynamic blocks in autocad using an excel list? The blocks should be placed at the coordinates (e.g. 10, 13, 201) of the list containing the attriubutes e.g. TAG, WIDTH and HEIGHT.

 

Example given:

TAGWIDTHHEIGHTxyz
A12101010
B11102010
C12103010
D12104010
E21105010

 

I made a few scripts in the past months but this exceeds my knowledge. I would be really thankful if somebody could guide me how to do this.

 

Kind regards,

Robert

 

0 Likes
Accepted solutions (1)
804 Views
5 Replies
Replies (5)
Message 2 of 6

JBerns
Advisor
Advisor

@Anonymous,

 

Just to clarify,  when you say "create dynamic blocks" do you mean create the block definition or insert a dynamic block already defined?

 

If the latter, would you be able to share a drawing that contains your dynamic block?

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
0 Likes
Message 3 of 6

Anonymous
Not applicable

Create a block definition, the block could be just a circle (e.g. diameter 5) with the named attributes.

If there is no way to create one, then i can define blocks in advance.

 

Thanks for the help in advance! 

 

Warm greetings,

Robert

0 Likes
Message 4 of 6

JBerns
Advisor
Advisor
Accepted solution

@Anonymous,

 

Does the block have to be a dynamic type? It becomes a bit more complicated to create a dynamic block programmatically.

 

If it can be a standard block, the X and Y scale can be adjusted to achieve the WIDTH and HEIGHT dimensions from the table. 

 

Does the table have to be an Excel file? A CSV file, being text, is much easier to read as compared to an Excel file.

 

Here are other forum posts where users needed to insert blocks by reading data from Excel/CSV files.

 

     Lisp to insert blocks from csv or excel file - AutoLISP, Visual LISP & DCL - AutoCAD Forums 

 

     Insert block, but reading from Excel - Autodesk Community - AutoCAD 

 

     HELP......With Insert Block Lisp From Excel File 

 

     Read CSV by Lee Mac 

 

Let us know if you need more assistance to develop the code.

 

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Message 5 of 6

Anonymous
Not applicable
Hi Jerry!

Thank you so much for the links! I actually managed to resolve my issue with an autocad script! Its not elegant but gets the work done!

The links you mentioned helped me alot! I will mark this answer as solution.

Regards,
Robert
0 Likes
Message 6 of 6

JBerns
Advisor
Advisor

Robert,

 

You are most welcome. Great to hear you have a solution. Glad to be of service.

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
0 Likes