ADSK2007 Posted August 22, 2012 Posted August 22, 2012 (edited) Hello all I have a lisp routine which will load Layer states and I have assigned it's command to a button - each layer state is assigned to a unique name and a button is created for it - The lisp routine loads a specific .las file into the drawing. For that, I have created a folder with all *.las files stored in it. The problem is that when I click on a button to turn on a layer state, it will apply the layer state to all viewports. How can I apply a layer state to only one viewport and not affect all viewports in all tabs? below is what I have (DEFUN C:d105 () (command "Layer" "A" "I" "J:/AutoCAD 2010/Lman/Development/105.las" "R" "105" "" "" "")) Thank you for helping Edited August 22, 2012 by ADSK2007 Quote
BIGAL Posted August 23, 2012 Posted August 23, 2012 Are you inside or outside the viewport when you run the command. Quote
ADSK2007 Posted August 23, 2012 Author Posted August 23, 2012 Hi BIGAL I use this line of code when I am inside the viewport - However, I found a way to rectify this - I wrote a Script using VPLAYER command. I turned layers ON and Some Off, then Tested the script to make sure it works fine. I then loaded the script with a lisp code and assigned it to a button. It works like a charm. NOTE: This routine works inside Viewport only and doesn't work in Model space Regards Adsk2007 Quote
irneb Posted August 24, 2012 Posted August 24, 2012 You can also use the layerstate-restore function in lisp. No need to have the VP set to current, just send the VP's ename to that function - you need not even be on the tab on which the VP is. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.