Author Topic: Coordinates of current Zoom Window  (Read 9885 times)

0 Members and 1 Guest are viewing this topic.

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: Coordinates of current Zoom Window
« Reply #15 on: April 01, 2014, 07:47:47 AM »
....old people, hehe! To make this more relevant you all aren't so old, my grandfather was programming military systems in fortran in the 50's and 60's.

I had a yr of FORTRAN in college, thank god for IBM

There's one old college text book wouldn't be worth 10 cents today. (why do I still have it.)

Bhull1985

  • Guest
Re: Coordinates of current Zoom Window
« Reply #16 on: April 01, 2014, 08:24:47 AM »
Memories? :)

hmspe

  • Bull Frog
  • Posts: 362
Re: Coordinates of current Zoom Window
« Reply #17 on: April 01, 2014, 08:47:38 AM »
Memories.  Yes.  Hollerith cards.  IBM 370. Fortran.  T.A. who wrote 'goto' with slashed through the o's.  Business students in the study room in the dorm who struggled with basic math, and engineering students who would do their homework (in seconds) to get them to stop griping about how hard their homework was.... 
"Science is the belief in the ignorance of experts." - Richard Feynman

ymg

  • Guest
Re: Coordinates of current Zoom Window
« Reply #18 on: April 01, 2014, 01:22:19 PM »
From Express Tools:

Code: [Select]
(ACET-GEOM-VIEW-POINTS)
Will return a list Lower Left and Upper Right as 3d points.

Code: [Select]
((3737.61 598.711 0.0) (10595.1 3058.81 0.0))
Timing for 1 000 000 repetitions:
Quote
ACET                      Elapsed: 1.528 sec.
ve                          Elapsed: 9.859 sec.
LM:ViewportExtents  Elapsed: 9.813 sec.
vpcords                  Elapsed: 9.891 sec.
« Last Edit: April 01, 2014, 01:42:10 PM by ymg »

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Coordinates of current Zoom Window
« Reply #19 on: April 01, 2014, 01:40:58 PM »
express tools, meh
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

ymg

  • Guest
Re: Coordinates of current Zoom Window
« Reply #20 on: April 01, 2014, 01:46:42 PM »

Quote
express tools, meh

 :lmao: Have to agree with you, it is a mixed bag.

ymg

hmspe

  • Bull Frog
  • Posts: 362
Re: Coordinates of current Zoom Window
« Reply #21 on: April 01, 2014, 02:42:51 PM »
But it is very simple code:

Code: [Select]
(defun acet-geom-view-points ( / a b c d x )
 (setq b (getvar "viewsize")
       c (car  (getvar "screensize"))
       d (cadr (getvar "screensize"))
       a (* b (/ c d))
       x (trans (getvar "viewctr") 1 2)
       c (list (- (car  x) (/ a 2.0))
               (- (cadr x) (/ b 2.0))
               0.0
         )
       d (list (+ (car  x) (/ a 2.0))
               (+ (cadr x) (/ b 2.0))
               0.0
         )
       c (trans c 2 1)
       d (trans d 2 1)
 )
 (list c d)
)
"Science is the belief in the ignorance of experts." - Richard Feynman

ymg

  • Guest
Re: Coordinates of current Zoom Window
« Reply #22 on: April 01, 2014, 03:04:35 PM »
hmspe,

no need to define it if you have Express Tool installed.

Believe it is part of aceutil.fas

All you need is:
Code: [Select]
(setq vext (ACET-GEOM-VIEW-POINTS))
ymg

hmspe

  • Bull Frog
  • Posts: 362
Re: Coordinates of current Zoom Window
« Reply #23 on: April 01, 2014, 05:11:33 PM »
ymg,

I understand, but there are those who either do not have express tools or will not use express tools because they cannot be locally maintained or because they can't be sure everyone has them installed.
"Science is the belief in the ignorance of experts." - Richard Feynman

danallen

  • Guest
Re: Coordinates of current Zoom Window
« Reply #24 on: April 01, 2014, 05:42:24 PM »
or on Bricscad!

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: Coordinates of current Zoom Window
« Reply #25 on: April 01, 2014, 06:15:30 PM »
lee,

I like the:

Code: [Select]
(apply '/ (getvar 'screensize))
Neat!

ymg

Thanks ymg  :-)

ymg

  • Guest
Re: Coordinates of current Zoom Window
« Reply #26 on: April 02, 2014, 08:59:30 AM »
@danallen,

Express Tools for Bricscad can be downloaded here: http://www.bricsys.com/common/applications/application.jsp?app=589

@hmspe,

I certainly do not advocate the use of acet for everything.  I was merely showing the possibilities.

As for the installed base, most everybody has them.

What is more of a problem is that documetation for them is kind of sparse,
plus some of the functions are less than ideal.  So your mileage may (will) vary.

ymg




Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Coordinates of current Zoom Window
« Reply #27 on: April 02, 2014, 09:03:16 AM »
< ..>

What is more of a problem is that documentation for them is kind of sparse,
plus some of the functions are less than ideal.  So your mileage may (will) vary.

ymg

That covers the issue very well, I think.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.