How do look field expression of one of your non-graphical linked field and how expression of one that has linked graphical elements?
Providing a simple example as a .gif demo so you can see the problem.
Usually I use alot of fields, inside of blocks/acad_tables but that doesn't seem to matter.
If there are no obvious differences why do you use fields for descriptions of not linked elements - isn't simple text or similar enough?
Say I have a floor plan, with 30 rooms - each room is represented by a closed lwpline and it also has an attributed block, standing for a "room label"..
so one attribute of that block is a field that refers to the lwpline's area. Also I used to generate a roomtable as ACAD_TABLE object, where the cells use fields aswell.
So on comming corrections I don't have to regenerate all of the information in form of new "room label" blocks and a "room table" - I just regen and the fields update.
Now you are asking then why I'd want to get rid of them? The answer is:
I copy the entire floor plans or all of the floor plans in order to draw facades/sections.
That means I'll rotate/move the plan and/or do whatever I want with it, and don't bother with the original one, that stays within my titleblock as finished.
So I erase that copy in the end, note that it contained all of the fields that were copied aswell.. so thats how their definitions sum up into that dictionary.
And all of this is a repetitive process:
getting a phone call to resize/move some window or door, then I make the changes on the "finished" floor plan, copy it, trace if I did all the required changes.
In the end before sending the architectural drawing to the structural/electrical/water supply designers,
I erase all of the fields, else the drawing gets too heavy for them and I get calls to resend a light version.
^^ BTW I've skipped all of these explanations to not get answers out-of-the-context like "your doing it wrong" or to "switch to BIM".If you have many fields, you store them all alltoghether in the same layer? How you differentiate them then if not by expressions they are generated?
I don't see how does the layer matters for the field definitions?
I could sort them out graphically and remove them but, the problem are the redundant ones inside the "ACAD_FIELDLIST" dictionary.
You said that you noticed there are those that have linked grapical entities - how then you noticed this - by erasing graphical data - field expressions become broken?
Again, check the demo.. although I could find the ones with broken links with:
(vl-remove-if-not '(lambda (x) (vl-some '(lambda (xx) (and (= 301 (car xx)) (wcmatch (cdr xx) "*`#*"))) (entget x))) (GetFieldDefinitions))
But that won't work when the actual entity is erased, where the field is located within.
If that's the case - erase all graphics, collect fields that are broken - store them in a list; undo grapical deletion and finally erase those left fields that don't belong to stored list...
Erase all graphics, collect fields that don't have references, which is different from broken links "####"
The problem is how to find out the field definitions that don't have references.
Attached that same test drawing.
