vplayer lisp

vplayer lisp

Anonymous
Not applicable
1,828 Views
4 Replies
Message 1 of 5

vplayer lisp

Anonymous
Not applicable

hello guys. have a good day

(defun c:vpf ()
 (setvar   "cmdecho" 0)
   (if (= (tblsearch "layer" "xr-aa"))     
    (command "vplayer" "f" "xr-aa" "c" "")
    )
    (if (= (tblsearch "layer" "xre-bb"))     
    (command "vplayer" "f" "xre-bb" "c" "")
    )  
(princ)
)

this lisp does not work. some help guys...

0 Likes
Accepted solutions (1)
1,829 Views
4 Replies
Replies (4)
Message 2 of 5

Satish_Rajdev
Advocate
Advocate

Try this:

(defun c:vpf (/ cm)
  (setq cm (getvar 'cmdecho))
(setvar "cmdecho" 0) (foreach x '("xr-aa" "xre-bb") ; <- Add your layer list here (if (tblsearch "layer" x) (command-s "vplayer" "f" x "c" "") ) ) (setvar "cmdecho" cm) (princ) )

Best Regards,
Satish Rajdev


REY Technologies | Linked IN | YouTube Channel


 

Message 3 of 5

ВeekeeCZ
Consultant
Consultant
Accepted solution

I would suggest to open the vplayer command, do all layers, then close the command. That way you'll create just one layer state for LAYERP.

 

(defun c:vpf (/ cm)
  (setq cm (getvar 'cmdecho))
  (setvar "cmdecho" 0)
  (command "vplayer")                     ; open the command
  (foreach x '("xr-aa" "xre-bb")          ; <- Add your layer list here
    (if	(tblsearch "layer" x)
      (command "f" x "c")))               ; process all layers
  (command "")                            ; close the command
  (setvar "cmdecho" cm)
  (princ)
  )
Message 4 of 5

dwattersAMXH5
Enthusiast
Enthusiast

you could also just set the layer list to a setq 
so rather then 

 (foreach x '("xr-aa" "xre-bb")          ; <- Add your layer list here

you could add this 

 

(setq layers '(layer list here))
(foreach x '("xr-aa" "xre-bb") layers 

if you planned to do anything else to that group of layers. 

Message 5 of 5

Anonymous
Not applicable

thank you all

0 Likes