Author Topic: active viewport  (Read 3252 times)

0 Members and 1 Guest are viewing this topic.

vladimirzm

  • Guest
active viewport
« on: March 04, 2009, 11:58:03 AM »
i need the active vport (model space vport)

(vla-get-ActiveViewport *doc*) --> always retunrs the same vport

from doc help:

"Use the StatusID property to determine if a viewport is currently active."
but i get error even for paper space vport:
(vla-get-StatusId vp)
; error: ActiveX Server returned the error: unknown name: StatusId

and
"You can iterate through existing viewports to find a particular viewport. To do this, first identify the name of the viewport configuration on which the desired viewport resides using the Name property." but:
(vlax-for x (vla-get-Viewports *doc*)
  (print (vla-get-name x))
)
returns
"*Active"
"*Active"
"*Active"
"*Active"
"*Active"
"*Active"
"*Active"
"*Active"

I have tried using cvport and enget without success
I thought it would be easy



T.Willey

  • Needs a day job
  • Posts: 5251
Re: active viewport
« Reply #1 on: March 04, 2009, 12:13:33 PM »
Code: [Select]
(setq ActVpEnt (ssname (ssget "_x" (list '(0 . "VIEWPORT") (cons 69 (getvar 'CVport)) (cons 410 (getvar 'CTab)))) 0))
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

vladimirzm

  • Guest
Re: active viewport
« Reply #2 on: March 04, 2009, 12:19:58 PM »
Code: [Select]
(ssget "_x" (list '(0 . "VIEWPORT") (cons 69 (getvar 'CVport)) (cons 410 (getvar 'CTab)) ))nil

T.Willey

  • Needs a day job
  • Posts: 5251
Re: active viewport
« Reply #3 on: March 04, 2009, 12:23:14 PM »
Then you are not in a floating model viewport.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

vladimirzm

  • Guest
Re: active viewport
« Reply #4 on: March 04, 2009, 12:50:10 PM »
i'm in model space (black screen)
i need model space active vport

T.Willey

  • Needs a day job
  • Posts: 5251
Re: active viewport
« Reply #5 on: March 04, 2009, 12:52:11 PM »
Don't know how to get the model space viewport.  I thought you were in a layout, and had an active floating viewport, and you wanted to get that.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

vladimirzm

  • Guest
Re: active viewport
« Reply #6 on: March 04, 2009, 01:13:24 PM »
in paper space is easy, vla-get-ActivePViewport works fine but in model space vla-get-ActiveViewport always returns the same entity.

VovKa

  • Water Moccasin
  • Posts: 1632
  • Ukraine
Re: active viewport
« Reply #7 on: March 04, 2009, 04:04:45 PM »
Code: [Select]
(car (vports))

vladimirzm

  • Guest
Re: active viewport
« Reply #8 on: March 05, 2009, 11:01:59 AM »
Code: [Select]
(car (vports))

these things should be documented

VovKa

  • Water Moccasin
  • Posts: 1632
  • Ukraine
Re: active viewport
« Reply #9 on: March 05, 2009, 11:07:11 AM »
actually they are
Quote
The current viewport's descriptor is always first in the list.
it's from acad_alr.chm

gile

  • Gator
  • Posts: 2520
  • Marseille, France
Re: active viewport
« Reply #10 on: March 05, 2009, 04:09:41 PM »
Hi,

Quote
(vla-get-ActiveViewport *doc*) --> always retunrs the same vport

Obviously, to update the active viewport, you have to 'vla-delete' it before.

Code: [Select]
(vla-delete (vla-get-ActiveViewport *doc*))
(vla-get-ActiveViewport *doc*)
Speaking English as a French Frog