Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with cvport in routine

Status
Not open for further replies.

vbcad

Technical User
Jul 12, 2002
159
US
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|*" "" "")
 
Hi vbcad,

Look into the SSGET function. It will do what you need.

HTH
Todd
 
I did take a look at SSGET however all ican seem to do with it is get a selection set of the viewport name. I can not get the viewport id number. SSGET selects the viewport and the polyline that created the viewport. I used a filter to get just the viewport but only gets the viewport name. I used this code.
Code:
 (setq ss1 (ssget '((0 . "viewport")))
)
 
Hi vbcad,

Right, but now you need to perform your entget on the items in your selection set - if I remember my AutoLISP correctly:

Code:
(setq SPLINES (ssget (list (cons 0 "spline"))))
  (progn
    ...
  (setq I 0)
  (while
    (setq SPL (ssname SPLINES I)
      (setq I (1+ I)
            ED (entget SPL)
      ); setq
...
..

HTH
Todd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top