Author Topic: Bug AutoCAD? Problem with xdata  (Read 2974 times)

0 Members and 1 Guest are viewing this topic.

Lupo76

  • Bull Frog
  • Posts: 343
Bug AutoCAD? Problem with xdata
« on: April 09, 2012, 03:48:41 AM »
Hello everyone,
are months that I use the following function to remove xdata, from an object:

Code: [Select]
(defun DeleteXdata (appname ent /)
  (entmod (list (cons -1 ent)(list -3 (list appname))))
  (princ)
)

Today I noticed that when I use this function to an object of type "ARC_DIMENSION" is issued the following error:

error: detected an exception: 0xC0000005 (Violation
access)
; Warning: unwind omitted except unknown


which often causes the crash of AutoCAD.  :x
Do you have any explanation?

Here below the code I use to test the problem:
Code: [Select]
(defun c:test (/ ogg)
  (setq ogg (car (entsel)))
  (addXdata ogg "TESTAPP" "IDCODE" "1")
  (DeleteXdata "TESTAPP" ogg)
)

(defun DeleteXdata (appname ent /)
  (entmod (list (cons -1 ent)(list -3 (list appname))))
  (princ)
)

(defun addXdata (ogg nomeapp labeldato valdato / lastent exdata newent datoesistente)
  (if (= (tblsearch "appid" nomeapp) nil)         
     (if (=  (regapp nomeapp) nil)
         (princ (strcat "\nSi è verificato un errore nell'applicazione " nomeapp "."))
     )
  )

  (setq lastent (entget ogg (list nomeapp)))
  (setq exlist (assoc -3 lastent))
  (if exlist
    (progn
       (setq thexdata (cdr (car (cdr exlist))))
       (setq dati (list (car thexdata)))
       (foreach datix thexdata (setq dati (append dati (list datix))))
       (setq thexdata (append (cdr dati) (list (cons ' 1000 (strcat labeldato "=" valdato)))))

       (setq exdata (list (cons ' -3 (list (cons nomeapp thexdata )))))
    )
    (setq exdata (list (cons ' -3 (list (cons nomeapp (list (cons ' 1000 (strcat labeldato "=" valdato))))))))
  )
  (setq lastent (entget ogg))
  (setq newent (append lastent exdata))
  (entmod newent)
)

I hope you can help me.



Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Bug AutoCAD? Problem with xdata
« Reply #1 on: April 09, 2012, 04:38:09 AM »

Which AutoCAD Version ?
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.

Lupo76

  • Bull Frog
  • Posts: 343
Re: Bug AutoCAD? Problem with xdata
« Reply #2 on: April 09, 2012, 09:19:54 AM »
AutoCAD 2012

Lupo76

  • Bull Frog
  • Posts: 343
Re: Bug AutoCAD? Problem with xdata
« Reply #3 on: April 10, 2012, 09:27:30 AM »
It just happens to me?  :realmad:
Can someone try a different version of AutoCAD2012?

If you have a solution would be even better!  :-D

HofCAD

  • Guest
Re: Bug AutoCAD? Problem with xdata
« Reply #4 on: April 12, 2012, 11:14:50 AM »
Found no problems in AutoCAD 2012 with the program Test,
but when I use it on ARC_DIMENSION I get:
Code: [Select]
; error: Exception occurred: 0xC0000005 (Access Violation)
; warning: unwind skipped on unknown exception
I get the same in AutoCAD 2010 when I use it on ARC_DIMENSION:
Code: [Select]
; error: Exception occurred: 0xC0000005 (Access Violation)
; warning: unwind skipped on unknown exception

Regards, HofCAD CSI.
« Last Edit: April 12, 2012, 11:59:16 AM by HofCAD »

Lupo76

  • Bull Frog
  • Posts: 343
Re: Bug AutoCAD? Problem with xdata
« Reply #5 on: April 13, 2012, 09:50:58 AM »
Ok, thanks for the confirmation.
I hope there is someone who has solved this problem ...  :-o