Problems with cvport in routine
Problems with cvport in routine
(OP)
Hello after struggling for a couple days I have come to the experts. I have a routine that selects a paperspace viewport and freezes and thaws layers as needed. I can select a viewport and it works fine if the viewport was created using mvsetup for example. where it fails is if the viewport was created using the object option. The routine selects the polyline and not the viewport the will not set the cvport variable. How do i filter out the polyline so it will only select the viewport object? Snippit of code below.
CODE
(defun c:ad (/ ss Vpid ss1)
(setvar "cmdecho" 0)
(setq scmde (getvar "cmdecho"))
(setq ss (car (entsel "\nselect viewport: ")))
(setq Vpid (cdr (assoc 69 (entget ss))))
(setq ss1 (entget ss))
(command "_.mspace")
(setvar "cvport" Vpid)
(command"vplayer" "f" "xref-*" "" "t" "xref-demo" "" "")
(command"-layer" "t" "demo|*" "f" "demo|A-FLOR-RMNA,demo|A-FLOR-RMNU,demo|A-FLOR-RMPB" "")
(command"vplayer" "f" "demo|*" "" "")
(setvar "cmdecho" 0)
(setq scmde (getvar "cmdecho"))
(setq ss (car (entsel "\nselect viewport: ")))
(setq Vpid (cdr (assoc 69 (entget ss))))
(setq ss1 (entget ss))
(command "_.mspace")
(setvar "cvport" Vpid)
(command"vplayer" "f" "xref-*" "" "t" "xref-demo" "" "")
(command"-layer" "t" "demo|*" "f" "demo|A-FLOR-RMNA,demo|A-FLOR-RMNU,demo|A-FLOR-RMPB" "")
(command"vplayer" "f" "demo|*" "" "")
RE: Problems with cvport in routine
Look into the SSGET function. It will do what you need.
HTH
Todd
RE: Problems with cvport in routine
CODE
)
RE: Problems with cvport in routine
Right, but now you need to perform your entget on the items in your selection set - if I remember my AutoLISP correctly:
CODE
(progn
...
(setq I 0)
(while
(setq SPL (ssname SPLINES I)
(setq I (1+ I)
ED (entget SPL)
); setq
...
..
HTH
Todd