TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Red Nova on May 16, 2017, 10:41:58 AM

Title: can a lisp program be a reason for layers to become corrupted?
Post by: Red Nova on May 16, 2017, 10:41:58 AM
Hello,
I am not sure, but have doubts that some of my recent lisps are causing this bug.
Some duplicate layers started to upper in my files. This can happen 1-2 times a day, but I cannot track which operation is causing this.
Duplicate layers start with real layer's name + @8, @48, ... See attached screenshot.
At the same time some objects that are affected show no layer at all in properties (blank). After merging layers and running audit $AUDIT-BAD-LAYER is created with problematic objects on it.
All of the affected objects are dynamic blocks (annotative).
I assumed this is due to a corrupted file, but other files also started to do the same.
I used an object reactor recently + reactor for layers from Lee Mac.
Also some of lisp that we use change layers sometimes.
Anybody seen this kind of behavior before? Might any lisp cause that?
Title: Re: can a lisp program be a reason for layers to become corrupted?
Post by: dgorsman on May 16, 2017, 12:13:54 PM
Avoid special characters in layer names, especially the standard "wildcard characters".  Wildcard matches are used to internally sort and filter the list by name, so when those characters are present they throw things for a loop.
Title: Re: can a lisp program be a reason for layers to become corrupted?
Post by: Red Nova on May 16, 2017, 12:23:43 PM
I do not have any "wildcard character" in layer names. "@" that you see was created when file went corrupted.
Initial layer was "BMP-Annotation".
Title: Re: can a lisp program be a reason for layers to become corrupted?
Post by: ronjonp on May 16, 2017, 12:46:23 PM
I do not have any "wildcard character" in layer names. "@" that you see was created when file went corrupted.
Initial layer was "BMP-Annotation".
I'd guess it's somewhere in your code .. I've never seen layer names rename themselves.  :?
Title: Re: can a lisp program be a reason for layers to become corrupted?
Post by: Lee Mac on May 16, 2017, 12:47:52 PM
I used an object reactor recently + reactor for layers from Lee Mac.

Nothing to do with my programs.
Title: Re: can a lisp program be a reason for layers to become corrupted?
Post by: Crank on May 20, 2017, 08:39:28 AM
This is because the drawing was saved in a version before the Acad2007-format.
Annotative scales were introduced in Acad2008. The names with @ in it represent the annotative scales because of backward compatibility.
Title: Re: can a lisp program be a reason for layers to become corrupted?
Post by: Red Nova on June 21, 2017, 03:42:21 PM
Sorry for abandoning the thread. Thanks everybody for their replies.
My vocation postponed me from understanding the reason sooner.
I was one by one removing all recent additions to my AutoCAD and testing it.
Eventually looks like I found what was causing the issue.
When I replaced recent dynamic blocks that I used for tagging mentioned errors stopped happening.
I assume something in a block definition was the reason.
I hope this post might help someone who face a similar issue in future.
Title: Re: can a lisp program be a reason for layers to become corrupted?
Post by: tedg on June 22, 2017, 07:07:48 AM
Sorry for abandoning the thread. Thanks everybody for their replies.
My vocation postponed me from understanding the reason sooner.
I was one by one removing all recent additions to my AutoCAD and testing it.
Eventually looks like I found what was causing the issue.
When I replaced recent dynamic blocks that I used for tagging mentioned errors stopped happening.
I assume something in a block definition was the reason.
I hope this post might help someone who face a similar issue in future.

Did you see Crank's post?
ThThis is because the drawing was saved in a version before the Acad2007-format.Annotative scales were introduced in Acad2008. The names with @ in it represent the annotative scales because of backward compatibility.

Is it possible that the dynamic blocks you speak of had annotative scales assigned to them, and that was the proble
m?

Title: Re: can a lisp program be a reason for layers to become corrupted?
Post by: Red Nova on June 22, 2017, 09:17:02 AM
ThThis is because the drawing was saved in a version before the Acad2007-format.Annotative scales were introduced in Acad2008. The names with @ in it represent the annotative scales because of backward compatibility.

Quote
Is it possible that the dynamic blocks you speak of had annotative scales assigned to them, and that was the proble[/size][/font]m?

Dynamic blocks had annotative scales. And I assume error is somehow connected to that. @8, @48, @64, all these numbers that were added to created layer names correspond to annotative scale factors of imperial scales that we use. Also those duplicate layers are created during saving.
But I only save drawings in 2013 format... Besides this I work in this environment for many months, using similar annotative dynamic blocks, same scales and same saving settings, but the problem occurred only after I was inserting some certain block into the file. Recreated those blocks from scratch and looks like now the error is gone.
Maybe combination of some error in the block and the fact that I am using annotative scales caused this error...