Jump to content

VPLayer Lisp to Freeze Selected Objects


Recommended Posts

Posted

Hi Guys,

 

 

Ok so I have been searching everywhere and even in here and I have not found anything in regards to my issue. I have created blocks with specific layer names. I know I can type VPLAYER then FREEZE then ENTER and SELECT OBJECTS then ENTER again twice in order for the layers to freeze in the view port. Well doing this over and over is pretty tedious. Is there a lisp routine that can be used to do all this functioning by typing lets say LLF [ENTER] and Selecting the objects in the Current View Port to freeze? Thanks in advance.

Posted

Ok so I found this, however, it only lets me select a single item. Is there a way to modify it to where I can select multiple objects?

 

 

(defun c:vlf ()
 (prompt
    "\nPick entity on the layer you want freeze in this Viewport: ")
 (setq name (cdr (assoc 8 (entget (car (entsel))))))
 (command "_vplayer" "f" name "" "")
 (princ)
)

Thanks in advance.

Posted

You can use ssget to select multiple objects and retrieve the object layer names, in a simple version it will execute the vplayer f for a layer multiple times if you pick objects on same layer.

 

(defun c:vlf ( / x layname ss )
 (prompt
    "\nPick entities on the layers you want freeze in this Viewport: ")
(setq ss (ssget ))

(setq x 0)
(repeat (sslength ss)
(setq layname (cdr (assoc 8 (entget (ssname ss x))))))
(command "_vplayer" "f" layname "" "")
(princ)
(setq x (+ x 1))
)
)

  • Like 1
Posted

Thanks BIGAL but it gives me the same result as the one above. I am trying to turn off multiple Objects in Multiple layers. When I use the original code or the one you provided, it does it one at a time. It doesn't turn all the layers off, it does it individually. I need for it to do it as a group.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...