×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Problems with cvport in routine

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|*" "" "")

RE: Problems with cvport in routine

Hi vbcad,

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

HTH
Todd

RE: Problems with cvport in routine

(OP)
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")))
)

RE: Problems with cvport in routine

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
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close