Saturday, November 21, 2009
Home   |   Search   |   About AUGI   |   My AUGI   |   Join Now

Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP
 Welcome, Guest. 

Login

Join Now FAQ Members List Calendar Search Today's Posts Mark Forums Read

AutoLISP AutoLISP or Visual LISP, learn both here!

Reply
 
Thread Tools Display Modes
Old 2004-06-29, 02:05 AM   #1
WBIRT
Member
 
Join Date: 2004-05
Posts: 3
WBIRT is starting their journey
Question Getting viewport scale using a lisp routine.

I have been trying to figure out how to get the viewport scale of a viewport so that I can use the scale in other functions. Just a note usually only have one viewport per tab.

Thanks for any help I can get.
Warren
WBIRT is offline   Reply With Quote
Old 2004-06-29, 02:15 AM   #2
mjfarrell
AUGI Addict
 
Join Date: 2001-10
Posts: 1,792
mjfarrell appears to be implodingmjfarrell appears to be imploding
Default RE: Getting viewport scale using a lisp routine.

Warren here is an example of similar code:

http://usa.autodesk.com/adsk/servlet...linkID=2475323
mjfarrell is offline   Reply With Quote
Old 2004-06-30, 02:27 AM   #3
WBIRT
Member
 
Join Date: 2004-05
Posts: 3
WBIRT is starting their journey
Talking RE: Getting viewport scale using a lisp routine.

Thank you very much, have been trying to figure that out for a week.
WBIRT is offline   Reply With Quote
Old 2004-06-30, 03:33 AM   #4
mjfarrell
AUGI Addict
 
Join Date: 2001-10
Posts: 1,792
mjfarrell appears to be implodingmjfarrell appears to be imploding
Default RE: Getting viewport scale using a lisp routine.

just to share how about post your finished code
so that others can see the power of sharing ideas?
mjfarrell is offline   Reply With Quote
Old 2004-06-30, 04:09 PM   #5
Ed Jobe
Administrator
 
Ed Jobe's Avatar
 
Join Date: 2000-11
Location: Turlock, CA
Posts: 3,411
Ed Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining star
Default RE: Getting viewport scale using a lisp routine.

Here's one I wrote a while back (chg the ext to lsp). It returns a value that can be used transparently in other commands. I also have a vba project on the Exchange for setting the vps by dialog.
Attached Files
File Type: txt Vs.txt (1.4 KB, 44 views)
__________________
──Ed ──
Ed Jobe is offline   Reply With Quote
Old 2004-06-30, 04:28 PM   #6
kieren
Member
 
kieren's Avatar
 
Join Date: 2003-04
Location: Stafford, UK
Posts: 34
kieren is starting their journey
Talking RE: Getting viewport scale using a lisp routine.

Wrote this some time ago (1996).
Feel free to use/modify/hash-up!!!

Full source in ZIP file - not protected.
I originally posted on www.cadalog.com and it had loads of good feedback and downloads.
Type VPTS at command line.

info:
You will be placed in modelspace. Pick a corner of an imaginary box around your detail. Now pick its opposite diagonal corner. Enter scale of detail as it would appear in paperspace. You are now placed in paperspace. Pick your insertion point for your viewport. You now have a viewport to your chosen scale around your detail. A box is also drawn in modelspace around your detail as a guide only. Modelspace and paperspace viewports are in no way connected or joined.

Enjoy!
Attached Files
File Type: zip vpts.zip (3.4 KB, 33 views)
__________________
..:: KIEREN ::..
Structural Draughtsman

Last edited by kieren : 2004-06-30 at 04:35 PM.
kieren is offline   Reply With Quote
Old 2004-06-30, 10:23 PM   #7
Tom Beauford
All AUGI, all the time
 
Join Date: 2001-03
Location: Tallahassee, FL
Posts: 518
Tom Beauford is a beam of lightTom Beauford is a beam of lightTom Beauford is a beam of lightTom Beauford is a beam of lightTom Beauford is a beam of lightTom Beauford is a beam of lightTom Beauford is a beam of lightTom Beauford is a beam of lightTom Beauford is a beam of lightTom Beauford is a beam of lightTom Beauford is a beam of light
Default RE: Getting viewport scale using a lisp routine.

Here's a menu item I used for years before AutoCAD created a control for it:

ID_VP_Scale [Viewport Scale]^C^C^P(if(= 0 (getvar "tilemode"))(progn(princ "PS:MS == 1:")(princ(/ 1 (car (trans '(1 0 0) 2 3 0))))(princ))(progn(prompt "** Command only allowed in Model Space (Floating) **")(princ)))

The only part you really need if you're in a layout (MS or PS) and want the Viewport Scale of the curent viewport (the one the MS command puts the curser in) is:
(car (trans '(1 0 0) 2 3 0))
__________________
Tom Beauford P.S.M. - Map 2010 +Eagle Point on XP
Design Analysis - Leon County Public Works/Engineering
2280 Miccosukee Rd. Tallahassee, FL 32308-5310
Ph# (850)606-1516
Tom Beauford is offline   Reply With Quote
Reply


Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Leader Lisp Routine that puts in the Elevation denton AutoLISP 8 2008-05-13 05:39 PM
ADT 3.0 - Zooming in Viewport emaydesign ACA General 7 2006-01-26 08:17 PM
Display a proper civil scale for a viewport RobertB AutoCAD Fields 2 2004-12-23 11:14 AM
Reactor to toggle LTScale between MS/PS RobertB AutoLISP 19 2004-06-29 02:39 PM
Design Center blocks not scaling properly mjsregister ACA General 3 2004-06-14 10:27 PM


All times are GMT +1. The time now is 01:49 PM.