Jump to content

Recommended Posts

Posted

Hi Folks,
I'm looking for an existing AutoLISP routine before writing one from scratch.

I need a Lisp for AutoCAD Tables (AcDbTable) that can detect text inside a table cell that has been separated using Alt+Enter (multiple lines within the same cell).

The desired workflow is:

Select one or more AutoCAD Lt tables.

Scan every cell.

Detect cells containing multiple lines (Alt+Enter line breaks).

Display the cell location (row and column).

Show each individual line with its line number.

Ask which line should be modified.

Ask for an AutoCAD Color Index (ACI).

Change the font color of only that specific line, while preserving all other formatting in the cell (font, text height, bold, italic, stacked text, fields, etc.).

Example:

Cell (Row 3, Column 5)

Line 1: Existing Text

Line 2: New Text

Line 3: Notes

Choose line to recolor: 2

ACI Color: 1 (Red)

Only Line 2 should become red.

Has anyone already written a Lisp that does something similar, or knows of an existing solution? Any links, examples, or source code would be greatly appreciated.

Posted (edited)

As the cell is Mtext you can set each line a different color, using the mtext color control. This was done manually. So will see maybe later will have time to do something. Have an idea will find the cells with multi line split into multi text lines, display the line and what color it is now so you can change any or all lines.

 

image.png.c0e2171c4f601064c11360a3c779192e.png

 

Looking at dwg it looks like you only want 2 colors 1 & 87 so will keep the multi color for later.

Edited by BIGAL
Posted

Need some more clarification, you ask for multi line to be different colors, but you have table that are multi row, not Multi line cells. That is a big difference. So if you just want tables with a heading and one row to be red, then any others with header and rows greater than 2 will be heading Red line rest green 87 lines. That can be done.

 

I think need to go back a step and work on the table creation in your other post as you pick boreholes there is no reason why the colors can not be set then. So will have a go at the other post, making single table for multiple boreholes much easier than trying to place individual tables for each borehole.

 

Will post something for you to say yes that is ok. 

 

I did ask about the source data where is the say Excel or csv that has the values that are being used in your tables, you have supplied a half answer.

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