AllExperts > AutoCAD 
Search      
AutoCAD
Volunteer
Answers to thousands of questions
 Home · More AutoCAD Questions · Answer Library  · Encyclopedia ·
More AutoCAD Answers
Question Library

Ask a question about AutoCAD
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Scott Cook
Expertise
I`ve been using AutoCAD since 1987 and programming AutoLISP nearly as long. I can answer questions about programming AutoCAD (except ARX) and production enhancement techniques. I cannot answer questions about AutoCAD crashes or DWG corruption. AutoCAD PROGRAMMING (menus, lisp) related questions only!

Experience
Since 1987. Author of Plot2000 software for for AutoCAD, http://www.plot2000.com. PROGRAMMING QUESTIONS ONLY PLEASE. Questions that are NOT related to programming or AutoCAD customization (menus and lisp only please) are outside the scope of my volunteer services and will NOT BE ANSWERED.
 
   

You are here:  Experts > Computing/Technology > Computer-Aided Design > AutoCAD > AutoLISP - determine screen resolution

AutoCAD - AutoLISP - determine screen resolution


Expert: Scott Cook - 11/11/2005

Question
How can you determine the screen resolution using Autolisp?  It's important when displaying slides.  You'd like to make them in 1024x768 or higher, but what if the user has 800x600 or lower?  Then you need a lower-res slide.  Can you determine the screen resolution with Autolisp so that you can display the highest resolution slide as possible?

Answer
here's a chunk of code that will do it for you. I had the same problem already with something else.

 (vl-load-com)
 (setq acadObject (vlax-get-acad-object))
 ;make sure window is maximized
 (if (/= (vlax-get-property acadobject 'windowstate) 3)
   (vlax-put-property acadobject 'windowstate 3)
 )
 ;figure out the screen resolution
 (setq screenwidth (vlax-get-property acadobject 'width))
 (setq screenheight (vlax-get-property acadobject 'height))

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.