Jump to content
ADSK2007

Loading Layer State Manager with a lisp

Recommended Posts

ADSK2007

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 by ADSK2007

Share this post


Link to post
Share on other sites
BIGAL

Are you inside or outside the viewport when you run the command.

Share this post


Link to post
Share on other sites
ADSK2007

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

Share this post


Link to post
Share on other sites
irneb

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.

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...