Jump to content

Need AutoLISP to Export TEXT/MTEXT to Excel (Advance Steel 2023)


Recommended Posts

Posted

Hi everyone,

 

I need an AutoLISP routine for Advance Steel 2023.

 

Requirements:

 

- Read all TEXT and MTEXT.
- All my drawings have the same format.
- Preserve the table layout exactly as shown in the drawing.
- Export to CSV or Excel.
- Columns are:
  1. Name of Assemblies
  2. Drawing No.
  3. Qty
  4. Total Weight

 

Sample DXF is attached.

 

Any help would be greatly appreciated.

1111 1.dxf

Posted

If your table layout is always the same, you don't need a very complicated AutoLISP.

A simple approach is:

* Read all TEXT and MTEXT entities.

* Sort them by Y coordinate (rows) and then X coordinate (columns).

* Group nearby text into the same row using a small Y tolerance.

* Map the four columns to Assembly Name, Drawing No., Qty, and Total Weight.

* Write the data to a CSV file (Excel opens CSV directly).

The biggest challenge isn't exporting—it's correctly identifying which text belongs to each row. Once the row grouping is reliable, CSV export is straightforward.

If you can share the sample DXF, someone can write a routine tailored to that table format, making it much more reliable than a generic text export.

Posted

The table format is standard and never changes.

Posted

Why don't use a Table Object in AutoCAD?

Posted
15 hours ago, Neelamegam said:

Hi everyone,

 

I need an AutoLISP routine for Advance Steel 2023.

 

Requirements:

 

- Read all TEXT and MTEXT.
- All my drawings have the same format.
- Preserve the table layout exactly as shown in the drawing.
- Export to CSV or Excel.
- Columns are:
  1. Name of Assemblies
  2. Drawing No.
  3. Qty
  4. Total Weight

 

Sample DXF is attached.

 

Any help would be greatly appreciated.

1111 1.dxf 736.06 kB · 6 downloads

(TTE-TBE) Text to Excel-unformat_byCamDuy.lsp @Neelamegam try it!

Posted (edited)

A couple of comments, making a table is much easier than rows and columns of *text, one advantage is read all the string number of characters so set correct column width to max STRLEN. Part 2 is have Table to Excel program or just write direct to Excel.

 

You provided a sample dwg but "I need an AutoLISP routine for Advance Steel 2023." so what are you trying to read from AS ? That makes more sense, export the desired answer without a intermediatory step. There is some code out there about reading AS object properties.

 

 

Edited by BIGAL

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...