Author Topic: Note regarding XData and AUDIT  (Read 3928 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Note regarding XData and AUDIT
« on: February 22, 2011, 09:22:55 PM »
This is a precautionary tale ...

I've had an application that add XData to entitys for identification and references to databases containg catalog information
... fairly simple app.

Over time the requirements for a string element in the XData has grown.
Recently it reached critical mass  :-o

The string is saved as normal in the XData and all processes work as expected.

BUT, the AUDIT command actually checks the length of XData strings and truncates the string to 255 characters.
ie
Quote
Auditing AutoCAD Data...
Pass 1 400     objects auditedAcDbBlockReference(232ED)
                     XData String Length 301 > 255      Truncate to 255
AcDbBlockReference(232FC)
                     XData String Length 301 > 255      Truncate to 255

.... so the data was hosed ... and it would only happen after an AUDIT.

My solution was to save the data as an XRecord and Dictionary attached to the entity.

Required a breaking change to the app but it's a lot more managable that not being able to read the data.


kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Note regarding XData and AUDIT
« Reply #1 on: February 22, 2011, 11:08:03 PM »
Thanks for the Heads Up.  8-)

I assume you ruled out compressing the data string?

I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Note regarding XData and AUDIT
« Reply #2 on: February 23, 2011, 01:44:38 AM »

Hello Alan

I considered it but wanted the data to be human readable without parsing.
( if I understand what you mean ) :)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Note regarding XData and AUDIT
« Reply #3 on: February 23, 2011, 07:49:33 AM »
You understand quite well. 8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Note regarding XData and AUDIT
« Reply #4 on: February 23, 2011, 11:13:10 AM »
Haven't run into that one yet directly; I've seen it indirectly with a professional application that uses XDATA.  Good thing I've already moved from XDATA to Dictionaries and XRecords.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Note regarding XData and AUDIT
« Reply #5 on: February 23, 2011, 12:50:14 PM »
A long shot here and could be a stupid question from an halfwit but I half to ask.

Would this cause Autocad to lock up with an JIT debug alert after running an Audit and purging Xdata?   (Note Windows Task Manager does not register that it is locked up but AutoCAD is.)
It will randomly crashed when I use either of these routines.  TotalPurge or QuickClean

I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Peter2

  • Swamp Rat
  • Posts: 650
Re: Note regarding XData and AUDIT
« Reply #6 on: December 12, 2016, 09:28:54 AM »
Nearly six years after first posting I want to refresh the topic:

In 2017 it seem to work fine with a string-length of 332; it can read and write the data. But "_audit" changes it:

Quote
"AcDbPolyline(29D)    XData String Length 332 > 255      Truncate to 255"

Is there a current reason for the limitation (in 2017) or is it because of legacy?
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2124
  • class keyThumper<T>:ILazy<T>
Re: Note regarding XData and AUDIT
« Reply #7 on: December 12, 2016, 06:22:58 PM »
Nearly six years after first posting I want to refresh the topic:

In 2017 it seem to work fine with a string-length of 332; it can read and write the data. But "_audit" changes it:

Quote
"AcDbPolyline(29D)    XData String Length 332 > 255      Truncate to 255"

Is there a current reason for the limitation (in 2017) or is it because of legacy?

I imagine you'd need to ask someone who is responsible for the design.
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Note regarding XData and AUDIT
« Reply #8 on: December 12, 2016, 08:41:04 PM »
It's more likely that it was a bug that allowed > 255 bytes (which is the spec) to be placed. Relying on an aberration that seemingly violates a spec or is not backward compatible is seldom a strategy that will end well. Hope the lesson is inconvenient rather than painful.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Peter2

  • Swamp Rat
  • Posts: 650
Re: Note regarding XData and AUDIT
« Reply #9 on: December 13, 2016, 04:53:57 AM »
...Hope the lesson is inconvenient rather than painful.
Yes, I detected it before anything bad happened.

Thanks for the answers.

Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23