TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: CADDOG on January 19, 2023, 08:21:00 PM
-
Has anybody every seen something like this.
Using the objects coordinates, it's in the middle of nowhere and invisible (even after UNISOLATE).
Note: I left off (1. ...), because it's just garble
Visual LISP Console
(setq corruptobj (entget (handent "20B252")))
((-1 . <Entity name: 22951557e20>) (0 . "CADWorx_Plant_Component") (5 . "20B252") (102 . "{ACAD_XDICTIONARY") (360 . <Entity name: 22951557e30>) (102 . "}") (102 . "{ACAD_REACTORS") (330 . <Entity name: 22951555a10>) (102 . "}") (330 . <Entity name: 22951533ad0>) (100 . "AcDbEntity") (67 . 0) (8 . "18027-SEAL POT_PU-1003$0$Equip") (100 . "AcDbModelerGeometry") (70 . 1) (290 . 1) (2 . "{85f06067-f75a-294e-b04b-1e54793bb661}") (100 . "AcDb3dSolid") (350 . <Entity name: 0>))
But notice here, I try to select it, and I get "Bad Entity name", of which I've not ever personally seen before.
Command: _SELECT
Select objects: (handent "20B252")
<Entity name: 22951557e20>
<Bad Entity name: 51557E20>
-
You dont need to select the handent is doing that for you.
: ERASE
Select entities, edges or faces: (handent "11C46")
<Entity name: 642f06a0>
Select entities, edges or faces:
press enter and is gone
-
Select or Erase, or anything, returns a Bad Entity...
Select was used to locate the object in question.
Command: ERASE
Select objects: (handent "20B252")
<Entity name: 229dbd44620>
<Bad Entity name: DBD44620>
The entget was to show that it should be a visible object (solid).
-
Have you tried running AUDIT on the dwg?
-
Have you tried running AUDIT on the dwg?
I have. I don't have the output, but the first audit was done without repairing, and it found 2 errors.
Second run with repair, found and only repaired 1 error. It wasn't not a visible object.
Still remains is the invisible 3d object with Bad Entity Name.
If the problem wasn't so rampant across so many drawings, I would just perform a copy paste into a new drawing, and be done with it. Ultimately my goal is to find and purge many drawings of these types of bad enames, but I was hoping someone here has seen this before so that I can try to find some characteristic to help with the purge.
There are more examples, but I figured simple questions get quicker answers.
Ex. I have identical CADWorx objects reported in the .dwg model space dictionary with the exact same xyz, but only one is visible. The other reports identical dxf data, but cannot be selected, and handent returns Bad Entity Name.
Of the 500+ project drawings investigated, I have 48 drawings with 337 duplicate (invisible) objects (no coincidence it is CADWorx). So, erase the invisible one in lisp or .net is not sustainable because I haven't found a means to discover which one is visible and which is not. Only then can I write something to iterate and purge the drawings.
-
I don't know off hand, but it wouldn't hurt to post a sample dwg.
If all the duplicate invisible objects are cadworx entities, have you contacted them for support?
-
I don't know off hand, but it wouldn't hurt to post a sample dwg.
Yeah.. I went back to the one with the handle in the first post, and others had already created a new version...
But the one attached is an invisible object, but doesn't return the bad ename error. Still a problem, it just got slightly more complicated. Some invisible objects have bad enames, and others are just invisible.
If all the duplicate invisible objects are cadworx entities, have you contacted them for support?
Upgrade is the response.
No dev analysis.
Though upgrade is doable, now that they've released SP1, but it doesn't solve the immediate problem.
-
Your dwg has quite a few problems:
- Autocad 2013 > purge > fatal error
- AutoCAD2023 can clean the file but not completely:
Comando: _audit AutoCAd 2013
Correggere qualsiasi errore trovato? [Ś/No] <N>: s
Verifica dell'intestazione
Verifica delle tabelle
Verifica delle entità della fase 1
Fase 1 31500 oggetti controllatiAcDb3dSolid(1BA00E) XData Handle Unknown Null
AcDb3dSolid(1BA00E) XData Handle Unknown Null
Trovato nome applicazione registrata "" non valido.
Modificato in "AUDIT_I_230121081207-0".
AcDb3dSolid(1C0921) XData Handle Unknown Null
Fase 1 33500 oggetti controllati
Verifica delle entità della fase 2
Fase 2 33500 oggetti controllati
Verifica dei blocchi
8 blocchi verificati
Verifica di AcDsRecords
Totale di 4 errori trovati: 4 corretti
Oggetti cancellati 0
-------------------------------------------------------------------------------------------------------
Command: LIST
Select objects: _all 7 found
Select objects:
BLOCK REFERENCE Layer: "0"
Space: Model space
Handle = 1c206d
Block Name: "CPM"
at point, X= 0'-0" Y= 0'-0" Z= 0'-0"
X scale factor: 1.0000
Y scale factor: 1.0000
rotation angle: 0.00
Z scale factor: 1.0000
Scale uniformly: No
Allow exploding: Yes
TEXT Layer: "PIPE-STEEL-CONC"
Space: Model space
Handle = 1c206b
Style = "STANDARD"
Annotative: No
Font file = simplex.shx
start point, X=2056'-9 5/8" Y=2213'-0 3/8" Z= 0'-0"
height 0'-10 9/16"
text 1C0A1A - VISIBLE OBJECT
rotation angle 0.00
width scale factor 0.8000
obliquing angle 0.00
generation normal
TEXT Layer: "PIPE-STEEL-CONC"
Space: Model space
Handle = 1c206a
Style = "STANDARD"
Annotative: No
Font file = simplex.shx
start point, X=2056'-9 5/8" Y=2214'-6 7/16" Z= 0'-0"
height 0'-10 9/16"
text 1C0921 - INVISIBLE
rotation angle 0.00
width scale factor 0.8000
obliquing angle 0.00
generation normal
BLOCK REFERENCE Layer: "0"
Space: Model space
Handle = 1c1f33
Press ENTER to continue:
Block Name: "CEM"
at point, X= 0'-0" Y= 0'-0" Z= 0'-0"
X scale factor: 1.0000
Y scale factor: 1.0000
rotation angle: 0.00
Z scale factor: 1.0000
Scale uniformly: No
Allow exploding: Yes
ACAD_PROXY_ENTITY Layer: "_01CS275C"
Space: Model space
Handle = 1c0a1a
Group = *A1
DXF name: CADWorx_Plant_Component
Class name: CADWorx_Plant_Component
Application name: CADWorxPlant
To disable this dialog from appearing
set PROXYNOTICE to 0.
Drawings created with CADWorx Plant can
be viewed in plain AutoCAD by loading
an Object Enabler(CADWorxPlant.dbx)
3DSOLID Layer: "_01CS275C"
Space: Model space
Handle = 1c0921
History = None
Show History = No
Bounding Box: Lower Bound X = 0'-0" , Y = 0'-0" , Z = 0'-0"
Upper Bound X = 0'-0" , Y = 0'-0" , Z = 0'-0"
3DSOLID Layer: "_09CS275B"
Space: Model space
Color: 1 (red) Linetype: "BYLAYER"
Handle = 1ba00e
History = None
Show History = No
Bounding Box: Lower Bound X = 0'-0" , Y = 0'-0" , Z = 0'-0"
Upper Bound X = 0'-0" , Y = 0'-0" , Z = 0'-0"
--------------------------------------------------------------------------
Command: AUDIT AutoCAd 2023
Fix any errors detected? [Yes/No] <N>: y
Auditing Header
Auditing Tables
Auditing Entities Pass 1
Pass 1 31400 objects auditedAcDb3dSolid(1BA00E) XData Handle Unknown Null
AcDb3dSolid(1BA00E) XData Handle Unknown Null
Pass 1 31500 objects audited
Invalid registered-application name "" found.
Changed to "AUDIT_I_230121082542-0".
AcDb3dSolid(1C0921) XData Handle Unknown Null
Auditing Entities Pass 2
Pass 2 31400 objects auditedAcDb3dSolid(1BA00E) could not be repaired. It will be Erased.
Pass 2 31500 objects auditedAcDb3dSolid(1C0921) could not be repaired. It will be Erased.
Auditing Blocks
3 Blocks audited
Auditing AcDsRecords
Total errors found 6 fixed 6
Erased 2 objects
--------------------------------------------
Command: AUDIT
Fix any errors detected? [Yes/No] <N>: y
Auditing Header
Auditing Tables
Auditing Entities Pass 1
Pass 1 31500 objects audited
Auditing Entities Pass 2
Pass 2 31500 objects audited
Auditing Blocks
3 Blocks audited
Auditing AcDsRecords
Total errors found 0 fixed 0
Erased 0 objects
edit kdub : removed forced formatting
-
I get this in ODA tool
-
checkout https://www.opendesign.com/guestfiles/oda_drawings_explorer. maybe this or another their utilities can help
-
checkout https://www.opendesign.com/guestfiles/oda_drawings_explorer. maybe this or another their utilities can help
Funny you mentioned ODA, because that's how we discovered the invisible duplicates (.net sdk), by indexing any object with two xyz duplicate coordinates. I'll dig into their docs to see. At least with a custom ODA audit, I can report what needs to be or should be deleted.
Thanks to all that tried helping me understand what's going on. I'll ping back if I make some progress worth sharing.