Thanks Grrr1337
Working perfict
Like this, I guess:Code - Auto/Visual Lisp: [Select]
Thanks Grrr1337
Both solutions working very well
Much more elegant than what I as going to suggest, my suggestion was going to be to see if the layername has | in it, if it does, it is an xRef layer since you can't add that character yourself to layer names.
_$ (vla-Add (vla-get-Layers (vla-get-ActiveDocument (vlax-get-acad-object))) "MyNew|Layer")
#<VLA-OBJECT IAcadLayer 00000093e05a3198>
@Grrr1337: In BricsCAD the _Audit command will fix such faulty names.Same in AutoCAD:
Command: AUDIT
Fix any errors detected? [Yes/No] <N>: y
Auditing Header
Auditing Tables
Auditing Entities Pass 1
Pass 1 200 objects audited
Non XREF-dependent record "Test|Test" contains vertical bar.
Changed to "AUDIT_I_171004093954-0".