TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lupo76 on April 09, 2012, 03:48:41 AM
-
Hello everyone,
are months that I use the following function to remove xdata, from an object:
(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:
(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.
-
Which AutoCAD Version ?
-
AutoCAD 2012
-
It just happens to me? :realmad:
Can someone try a different version of AutoCAD2012?
If you have a solution would be even better! :-D
-
Found no problems in AutoCAD 2012 with the program Test,
but when I use it on ARC_DIMENSION I get:
; 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:
; error: Exception occurred: 0xC0000005 (Access Violation)
; warning: unwind skipped on unknown exception
Regards, HofCAD CSI.
-
Ok, thanks for the confirmation.
I hope there is someone who has solved this problem ... :-o