Text style that isn't use and cannot be purged

Text style that isn't use and cannot be purged

Brian.TsaiF883G
Participant Participant
977 Views
16 Replies
Message 1 of 17

Text style that isn't use and cannot be purged

Brian.TsaiF883G
Participant
Participant

The attached file is what I am able to isolate as the problem

 

everything says that I only have have 'standard' text style

 

when it is in table, the cell states it is 'Standard' text style

 

after purging, auditing, and scalelistedit reset, it still has the 2 text styles

 

i can achieve only 'standard' text style by either

a) i explode the table into lines and MText and proceed with above, 

 

b) manually edit new text in Table cell

 

the 'find' and replace function does not delete the non'standard' text style

 

any reason the attached file text is special?

 

I am trying to make a lisp that would get rid these special text's text style and set it to 'standard' text style

 

 

0 Likes
Accepted solutions (1)
978 Views
16 Replies
Replies (16)
Message 2 of 17

Sea-Haven
Mentor
Mentor

 I just did a purge and the 2nd text style was there and its gone now. 

0 Likes
Message 3 of 17

Brian.TsaiF883G
Participant
Participant

I'm using Product Version: Q 47.0.0 AutoCAD 2020 and it failed
Product Version: Q 51.0.0 AutoCAD 2022 and it failed

what version are you using?

 

BrianTsaiF883G_0-1741330135356.png

 

0 Likes
Message 4 of 17

Sea-Haven
Mentor
Mentor

Bricscad V25. A sometimes add a text using other style then erase and try purge again.

 

0 Likes
Message 5 of 17

paullimapa
Mentor
Mentor

These are the steps I took to manually remove & then purge Style:

 RHIO-1020-ME-PAD-0005.02.IFC.02.01_PDS$0$CSI TITLE BLOCK

First the Purge command confirms that style is Non-Purgeable & in use inside a Table:

paullimapa_1-1741330594052.png

Next I use the TABLEDIT command & selected the Cell then immediately clicked a point outside the Table to conclude the command without changing anything.

paullimapa_2-1741330964602.png

Now when I enter the PURGE command that style is purgeable:

paullimapa_3-1741331160390.pngpaullimapa_4-1741331228557.png

 

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 6 of 17

Brian.TsaiF883G
Participant
Participant

thanks that works

but i have many many of these cases randomly in random tables and in a random files

 

What i don't understand is, why is it happening when the properties states it is 'Standard' text style and why we have to go through 'Tabledit' to 'refresh' it?

is there a lisp/ reasoning the text style is unpurgable without 'Tabledit' first?

0 Likes
Message 7 of 17

paullimapa
Mentor
Mentor

This may give you a hint on how to do this on a mass selection set:

There's a routine written by Tharwat here called Test.lsp:

https://www.cadtutor.net/forum/topic/63542-table-cell-style-via-lisp/

(defun c:Test ( / sty tbl obj row col r c)
 ;;	Tharwat - Date:  11.Jul.2017	;;

; (setq sty "Standard") ;; Change the Text Style to suit your desired one.
 (setq sty "Arial") ;; Change the Text Style to suit your desired one.
 (if (and (or (tblsearch "STYLE" sty)
            (alert (strcat "Text style <" sty "> is not found in drawing <!>"))
            )
        (princ "\nPick on Table :")
        (setq tbl (ssget "_+.:S:E:L" '((0 . "ACAD_TABLE"))))
        (setq obj (vlax-ename->vla-object (ssname tbl 0))
              row (vla-get-rows obj)
              col (vla-get-columns obj)
              r 0 c 0
              )
        )
   (repeat row
     (repeat col
       (vla-setcelltextstyle obj r c sty) (setq c (1+ c))
       )
     (setq r (1+ r) c 0)
     )
   )
 (princ)
 )

 It allows you to select one Table object to change the Text Style in all the cells.

So what I did was first created a new Style called Arial using Arial.ttf font.

Then I ran the Test.lsp function to change the selected Table cell Style to Arial.

Then I'm able to Purge the problem Style.

Then I edited Test.lsp function to change the selected Table cell Style back to Standard.

After that I Purge the Arial Text Style.

 

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 8 of 17

cadffm
Consultant
Consultant

Hi,

 

because it wasn't the challange to change styles in tables, you can use this "UpdateTables" command, what does not change the table.

(you have to manage layer locking on your own)

 

 

 

; updated code
(defun c:UpdateTables ( / tbls)
   (if (setq n -1 tbls (ssget "_X" '((0 . "ACAD_TABLE"))))
       (repeat (sslength tbls)
         (entmod (entget(ssname tbls (setq n (1+ n)))))
       )
   )
 (princ)
)

 

 

 

 

 
 

 

 

 
 

 

 

Sebastian

Message 9 of 17

pendean
Community Legend
Community Legend

@Brian.TsaiF883G Do you folks not implement and use CHECKSTANDARDS tools? You create a standards template file to address these non-standards types of issues then run it.

Message 10 of 17

paullimapa
Mentor
Mentor

excellent routine to fix the problem!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 11 of 17

Brian.TsaiF883G
Participant
Participant

Many thanks.

 

I didn't know about CHECKSTANDARDS 

 

I tried CHECKSTANDARDS and now i have problem fixing many many dimensions one by one

 

I tried the Batch Standard Checker and it only generates a report without fixing them

 

I tried to reprogram the code below but failed to get it to update all tables in all block references

 

can anyone point out which part in the code below need fixing?

 

(defun c:BUT ( / tbls blkname blklist ent)
  
    (if (setq n -1 tbls (ssget "_X" '((0 . "ACAD_TABLE"))))
       (repeat (sslength tbls)
         (entmod (entget(ssname tbls (setq n (1+ n)))))
       )
   ) 
  
  (while (setq blkname (cdadr (tblnext "block" (not blkname))))
    (if
      (not
        (or
          (wcmatch blkname "`*D*,*|*"); Dimension or Xref-dependent
          (assoc 1 (tblsearch "block" blkname)); an Xref
          (member blkname blklist); already in the list
        ); or
      ); not
      (setq blklist (cons blkname blklist))
    ); if
  ); while
  (foreach blkname blklist
    (setq ent (tblobjname "block" blkname))
    (while (setq ent (entnext ent))
 
(if (wcmatch (cdr (assoc 0 (setq edata (entget ent)))) "ACAD_TABLE")
 
; (if (setq n -1 tbls (ssget "_X" '((0 . "ACAD_TABLE"))))
;      (repeat (sslength tbls)
         (entmod (entget(ssname tbls (setq n (1+ n)))))
;       )
)
  
  
    ); while
  ); foreach
  
    
   
 (princ)
)
0 Likes
Message 12 of 17

cadffm
Consultant
Consultant
Accepted solution

Untested.

 

at the end you are using

(entmod (entget(ssname tbls (setq n (1+ n)))))

 

what doesn't make any sense, replace it with

(entmod edata)

 

try it again.

I didn't searched for other issues

Sebastian

Message 13 of 17

Brian.TsaiF883G
Participant
Participant

It works!

 

Many thanks 🙂

0 Likes
Message 14 of 17

Brian.TsaiF883G
Participant
Participant

I have a new case with the same problem but this time, it is on a leader entity with no text at all

 

Is there any reason this leader entity is so special?

0 Likes
Message 15 of 17

Sea-Haven
Mentor
Mentor

Just a guess its buried away in side your table style some how. Do you start drafting with a DWT or pick an existing dwg ? You may need a "Clean" dwg to start with. What happens if you use a good dwg and erase everything in Model & layouts.

 

There is a message about the style being referenced. I know for another project with errors on load it took hours to find a style in dwg objects.

0 Likes
Message 16 of 17

Brian.TsaiF883G
Participant
Participant

True

 

But I'm dealing with various drawings at the moment so there are many inconsistencies in random files.

 

So now I am trying to 'controlled clean' up all so that will not affect intentional formatting/information in the drawing.

Does anyone know why leader entity have embedded text style?

0 Likes
Message 17 of 17

cadffm
Consultant
Consultant

Hi,

 

>>"Does anyone know why leader entity have embedded text style?"

EDITED: Why THIS leader entity refers to a Style: I don't know it. Because someone changed the arrowhead, in this case the text style will linked as override to the leader object.

But I'm not so good with LEADER objects either, they're really cool if you don't just use the ootb editing tools.

 

It's new for me in Acad that DSTYLE  informations contains a Style-1005

Perhaps generated from the Pro Stahl 3D Application?

 

 

Sebastian

0 Likes