Cracked it !... well after a fashion anyway...
I found this Lisp on Cyco's despicable site after some trawling and just in case it may be useful for someone sometime somewhere...
To load the functions open the BaseLISP evaluator, load the BaseLISP file HydeLaye.lsp and execute it. Now a pulldown menu as displayed is available and from here all functions can be called.
When an AutoCAD drawing is displayed the function “Hide Layers” will display a dialogue with all layers in this AutoCAD drawing. By selecting one of those layers you will register that layer as not displayed for every AutoCAD drawing that is managed by AM-WorkFlow.
The function “Unhide Layers” will display a dialogue with all layers that are switched off by means of “Hide Layers” and that then can be switched on again.
“List hidden Layers” will display a dialogue with all layers that are switched off.
The layers that should not be displayed are registered in the user profile of the current user <USER>.ABU. The special section is "ViewMan.Vector.AutoCadDwgDxf" and the special key is "HideLayers". The layers that should not be displayed are stored as a string of names separated by a semicolon ( ; ).
So I just logged in as my user, ran the lisp, selected the layer I wanted hidden from them and hit the button ~
note: you have to restart AMW for the changes to take effect. Now the customers name (layer) is hidden for all drawings, and thus, does not plot for that particular user. The customers name is still visible in the database though if they need it. But that solves my plotting problem.
Further note: make sure you run it in the Baselisp Evaluator, and don't load it through the <your-ENV>.lsp otherwise the user will have full access to the drop down menu.
Now why couldn't they just have put that information in the damn help file ? (I use the term "help file" very loosely !)
(setq HideSection "ViewMan.Vector.AutoCadDwgDxf")
(setq HideKey "HideLayers")
;;; REMOVE A LAYERNAME FROM A LIST OF STRINGS
(defun RemoveFromList (String InList / OutList)
(setq OutList '())
(while (length InList)
(if (s/= String (first InList))
(setq OutList (append OutList (list (first InList))))
);end if
(setq InList (rest InList))
);end while
OutList
);end defun
;;; ADD A LAYERNAME TO A LIST OF STRINGS
(defun StrToList (Separator String / OutList SepPos)
(setq OutList '())
(while (and (strlen String) (s/= Separator String))
(if (s= (leftstr String 1) Separator)
(setq String (substr String 2))
);end if
(setq SepPos (strstr String Separator))
(setq OutList (append OutList (list (if SepPos (leftstr String (- SepPos 1)) String))))
(setq String (if SepPos (substr String (+ 1 SepPos)) ""))
);end while
OutList
);end defun
;;; CONVERT A LIST TO A STRING WITH THE ENTRIES SEPERATED BY A SEPERATOR
(defun ListToStr (Separator InList / String)
(setq String "")
(while (> (length InList) 1)
(setq String (strcat String (first InList) Separator))
(setq InList (rest InList))
);end while
(if (length InList)
(setq String (strcat String (first InList)))
);end if
String
);end defun
;;; REQUEST LIST OF HIDDEN LAYERS
(defun GetHiddenLayers ()
(StrToList ";" (getabuvar HideSection HideKey))
);end defun
;;; DISPLAY HIDDEN LAYERS
(defun ListLayers ()
(messagebox "Hidden Layers" (ListToStr "\n" (GetHiddenLayers)) "O" "A")
);end defun
;;; HIDE LAYERS
(defun HideLayers ( / NoLayers Layer Section LayerList Expr)
(setq LayerList '())
;;; Build a list of all present layers
(setq NoLayers (getviewervar "OpenDoc.Layer" "NoLayers"))
(setq Layer 0)
(while (< Layer NoLayers)
(setq Section (strcat "OpenDoc.Layer." Layer))
(setq LayerList (append LayerList (list (getviewervar Section "Name"))))
(setq Layer (+ Layer 1))
);end while
;;; As long as there are layernames in the list
(if (length LayerList)
(progn
;;; Build a dialog to display them
(setq Expr (append
(list 'setqselectbox 'Layer "Hide Layers" "Select a Layer to hide"
(first LayerList) "OC" "Q")
LayerList)
);end setq
;;; Start the dialog and ask which layers should be hidden and store that
;;; value in the user-profile
(if (/= 0 (eval Expr))
(progn
(setq LayerList (StrToList ";" (getabuvar HideSection HideKey)))
(setq LayerList (append LayerList (list Layer)))
(setabuvar HideSection HideKey (ListToStr ";" LayerList))
);end progn
);end if
);end progn
);end if
(refresh)
);end defun
;;; UNHIDE LAYERS
(defun UnhideLayers ( / LayerList Layer Expr)
;;; Request the list with hidden layers from the user-profile
(setq LayerList (GetHiddenLayers))
;;; As long as there are layernames in the list
(if (length LayerList)
(progn
;;; Build a dialog to display them
(setq Expr (append
(list 'setqselectbox 'Layer "Unhide Layers" "Select a Layer to unhide"
(first LayerList) "OC" "Q")
LayerList)
);end setq
;;; Start the dialog and ask which layers should be made unhidden and store the
;;; new value of still hidden layers in the user-profile
(if (/= 0 (eval Expr))
(progn
(setq LayerList (StrToList ";" (getabuvar HideSection HideKey)))
(setq LayerList (RemoveFromList Layer LayerList))
(setabuvar HideSection HideKey (ListToStr ";" LayerList))
);end progn
);end if
);end progn
);end if
(refresh)
);end defun
(defun VIEWDOC ()
(docview "Hidelaye.doc")
)
(mainmenu-delete "AutoCAD La&yer Control")
(mainmenu-add "AutoCAD La&yer Control")
(submenu-add "AutoCAD La&yer Control" "&Hide Layers" 'HideLayers)
(submenu-add "AutoCAD La&yer Control" "&Unhide Layers" 'UnhideLayers)
(submenu-add "AutoCAD La&yer Control" "&List hidden Layers" 'ListLayers)
;(submenu-add "AutoCAD La&yer Control" "Explanation" 'VIEWDOC)