Results 1 to 5 of 5

Thread: question about degrees in turning instead of fixed degrees turning in viewport

  1. #1
    Member
    Join Date
    2008-01
    Posts
    5

    Default question about degrees in turning instead of fixed degrees turning in viewport

    Hai guys,
    How can I, instead of a fixed 90 degrees, make it a question of how much degrees it's going to be?
    So that I don't have to use 3 scripts.



    Code:
    (DEFUN C:viewportrotate90 ()
    (SETVAR "CMDECHO" 0)
    (COMMAND "PSPACE")
    (COMMAND "-vports" "lock" "off" "all" "")
    
    (COMMAND "MSPACE")
    (command "ucsicon" "on")
    (command "dview" "" "tw" "90" "")
    
    (COMMAND "-vports" "lock" "on" "all" "")
    (COMMAND "MSPACE")
    (command "ucs" "view")
    
    (setvar "cmdecho" 1)
    
    (princ "\nViewport rotated to UCS 90.")
    (PRINC))
    Last edited by Opie; 2008-01-14 at 01:35 PM. Reason: [CODE] tags added, see Moderator Note

  2. #2
    100 Club
    Join Date
    2007-08
    Posts
    172

    Default Re: question about degrees in turning instead of fixed degrees turning in viewport

    Hi,

    Have a look at the getangle (and getorient) function.

  3. #3
    Member
    Join Date
    2008-01
    Posts
    5

    Default Re: question about degrees in turning instead of fixed degrees turning in viewport

    I'm not that good at it, that's why I'm asking those questions. In that case 2 out of 5 problems are solved.

  4. #4
    100 Club
    Join Date
    2007-08
    Posts
    172

    Default Re: question about degrees in turning instead of fixed degrees turning in viewport

    something like this:

    Code:
    (DEFUN C:viewportrotate (/ ang)
      (SETVAR "CMDECHO" 0)
      (COMMAND "_PSPACE")
      (COMMAND "_-vports" "_lock" "_off" "_all" "")
    
      (setq ang (getangle "\nSpecify Rotation angle: "))
    
      (COMMAND "_MSPACE")
      (command "_ucsicon" "_on")
      (command "_dview" "" "_tw" (angtos ang) "")
    
      (COMMAND "_-vports" "_lock" "_on" "_all" "")
      (COMMAND "_MSPACE")
      (command "_ucs" "_view")
    
      (setvar "cmdecho" 1)
    
      (princ (strcat "\nViewport rotated to UCS " (angtos ang)))
      (PRINC)
    )

  5. #5
    AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL
    Posts
    1,120

    Default Re: question about degrees in turning instead of fixed degrees turning in viewport

    Why not try a macro:
    Code:
     -vports;_lock;_ON;;_dview;all;;tw;\;^P(progn(setvar "snapang" (- (getvar "viewtwist")))(princ))
    I never lock my viewports, save a lot of MS views to protect my work instead. As easy as they are to lock/unlock simply locking a viewport wouldn't make me feel very secure.
    Tom Beauford P.S.M. - Civil 2013 on Windows 7 Pro
    Design Analysis - Leon County Public Works/Engineering
    2280 Miccosukee Rd. Tallahassee, FL 32308-5310
    Ph# (850)606-1516

Similar Threads

  1. Help! Problem with tags! (turning into question marks)
    By kappy in forum Revit Architecture - General
    Replies: 6
    Last Post: 2010-05-26, 11:41 PM
  2. Rotate 90 Degrees
    By ntopliffe in forum Revit MEP - General
    Replies: 1
    Last Post: 2009-08-14, 01:05 AM
  3. HVAC - Turning vanes in Duct Corner (90 degrees)
    By CAD Brad in forum AutoLISP
    Replies: 8
    Last Post: 2008-10-30, 07:45 PM
  4. using degrees instead of pitch
    By thomasf in forum Revit Architecture - General
    Replies: 2
    Last Post: 2008-10-07, 09:17 PM
  5. viewport turning itself off
    By horvatt in forum AutoCAD General
    Replies: 1
    Last Post: 2004-09-14, 09:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •