Sorry to interrupt you again BeekeeCZ....
I've changed my lisp file. The lisp file must create a parent filter first (called "No_Xref_Layers") and after this filter is created, it has to create more filters.
If I use the command "Xrefnot" or "createfilters" one by one, it's no problem.
But if I combine these commands in the lisp file, by creating another command, it doesn't work. They are "unknown commands" after using the lisp.
Something is wrong, but I can't figure it out..
This is the combined lisp file:
(defun c:XREFNOT ( / xdict dict xrecname )
(vl-load-com)
(setq xdict
(vlax-vla-object->ename
(vla-getextensiondictionary
(vla-get-layers
(vla-get-activedocument (vlax-get-acad-object))
)
)
)
)
(setq dict
(if (setq dict (dictsearch xdict "ACAD_LAYERFILTERS"))
(cdr (assoc -1 dict))
(dictadd xdict "ACAD_LAYERFILTERS"
(entmakex
'(
(0 . "dictionary")
(100 . "AcDbDictionary")
(280 . 0)
(281 . 1)
)
)
)
)
)
(princ
(if (dictsearch dict (setq xrecname "No_Xref_Layers"))
(strcat
"Layer filter named <"
xrecname
"> already exists."
)
(if
(dictadd dict xrecname
(entmakex
(append
'(
(0 . "xrecord")
(100 . "AcDbXrecord")
(280 . 1)
)
(list (cons 1 xrecname))
'(
(1 . "~*|*")
(1 . "*")
(1 . "*")
(70 . 0)
(1 . "*")
(1 . "*")
(-3
( "ACAD"
(1000 . "( NAME== \"~*|*\" )")
)
)
)
)
)
)
(strcat
"Created layer filter named <"
xrecname
">."
)
)
)
)
(command ".-layer" "filter" "set" "No_Xref_Layers" "")
(princ)
);_End of defun
(Defun C:createfilters ()
(Command "-layer" "filter" "n" "g" "No_Xref_Layers" "**" "Lagen" "")
(Command "-layer" "filter" "n" "g" "Lagen" "*57*" "" "57 - LUCHT" "")
(Command "-layer" "filter" "n" "g" "Lagen" "*56*" "" "56 - CV" "")
(Command "-layer" "filter" "n" "g" "Lagen" "*55*" "" "55 - GKW" "")
(Command "-layer" "filter" "n" "g" "Lagen" "*54*" "" "54 - GASSEN" "")
(Command "-layer" "filter" "n" "g" "Lagen" "*53*" "" "53 - WATER" "")
(Command "-layer" "filter" "n" "g" "Lagen" "*52*" "" "52 - RIOOL" "")
(Command "-layer" "filter" "n" "g" "Lagen" "*5*" "" "5 - W-INSTALLATIE" "")
(Command "-layer" "filter" "n" "g" "Lagen" "*WM*" "" "5X - MAATVOERING" "")
(Command "-layer" "filter" "n" "p" "No_Xref_Layers" "Eigenschappen" "Eigenschappen" "")
(Command "-layer" "filter" "n" "p" "Eigenschappen" "frozen==\"true\"" "" "frozen" "")
(Command "-layer" "filter" "n" "p" "Eigenschappen" "off==\"true\"" "" "off" "")
(Command "-layer" "filter" "n" "p" "Eigenschappen" "off==\"false\" and frozen==\"false\"" "" "on" "")
(Command "-layer" "filter" "n" "p" "Eigenschappen" "frozen==\"false\"" "" "thawed" "")
(Command "-layer" "filter" "n" "p" "Eigenschappen" "locked==\"true\"" "" "locked" "")
(Command "-layer" "filter" "n" "p" "Eigenschappen" "locked==\"false\"" "" "unlocked" "")
(Command "-layer" "filter" "n" "p" "Eigenschappen" "plottable==\"false\"" "" "no plot" "")
(princ)
);_End of defun
(Defun C:ftr ()
(Command "qsave")
(Command "xrefnot")
(Command "createfilters")
(princ "\n...All layer filters have been created.")
(princ)
)