Page 1 of 4 1234 LastLast
Results 1 to 10 of 34

Thread: match annotation scale to viewport scale

  1. #1
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default match annotation scale to viewport scale

    is there an easy way to automatically set all viewports so the annotation scale is equal to the viewport scale. I use Eagle Point to create plan and profile sheets, when it creates a viewport, it applies the viewport scale, but does not adjust the annotation scale. It would be nice to have this done automatically so our hatches and other annotative objects show up properly.

    Thanks,

  2. #2
    All AUGI, all the time CADDmanVA's Avatar
    Join Date
    2006-12
    Location
    New Orleans, LA
    Posts
    881
    Login to Give a bone
    0

    Default Re: match annotation scale to viewport scale

    Eh...that's a rough one. I don't have a direct answer, but a trick. You can select multiple Viewports (or use a the selection filter) and set them all that way. I'm not familiar with how Eagle Point works anymore (thankfully), but I can't think of any other way. Maybe one of the geniuses in the LISP and API forums have a trick up their sleeves?

  3. #3
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: match annotation scale to viewport scale

    Quote Originally Posted by CADDmanVA View Post
    ... Maybe one of the geniuses in the LISP and API forums have a trick up their sleeves?
    It just so happens that I've been working on that this week. My proof-of-concept code works, but it will be the end of the week before I can revisit the code for final polish.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  4. #4
    All AUGI, all the time CADDmanVA's Avatar
    Join Date
    2006-12
    Location
    New Orleans, LA
    Posts
    881
    Login to Give a bone
    0

    Default Re: match annotation scale to viewport scale

    Quote Originally Posted by RobertB View Post
    It just so happens that I've been working on that this week. My proof-of-concept code works, but it will be the end of the week before I can revisit the code for final polish.
    Wow. Thanks Robert. I didn't expect a response that quick, or without having to post it in the LISP forums. Wow!

  5. #5
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: match annotation scale to viewport scale

    Quote Originally Posted by CADDmanVA View Post
    Wow. Thanks Robert. I didn't expect a response that quick, or without having to post it in the LISP forums. Wow!
    I'm confused, this is the LISP forum. anyway, Robert, bring it on, I tried a couple of other methods that someone gave me to try and they didnt seem to work the way I expected, too much user interaction.

  6. #6
    All AUGI, all the time CADDmanVA's Avatar
    Join Date
    2006-12
    Location
    New Orleans, LA
    Posts
    881
    Login to Give a bone
    0

    Default Re: match annotation scale to viewport scale

    Quote Originally Posted by ccowgill View Post
    I'm confused, this is the LISP forum. anyway, Robert, bring it on, I tried a couple of other methods that someone gave me to try and they didnt seem to work the way I expected, too much user interaction.
    Whoops...my bad. I thought this was the Annotative Scale forum.

  7. #7
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: match annotation scale to viewport scale

    Quote Originally Posted by RobertB View Post
    It just so happens that I've been working on that this week. My proof-of-concept code works, but it will be the end of the week before I can revisit the code for final polish.
    Any chance that you had time to polish your program? I am planning on working on redoing our Eagle Point settings over the long holiday and would like to look at starting to use annotative objects

  8. #8
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: match annotation scale to viewport scale

    just to bring this back to the top, does anyone have any advice on how to achive this. I have a program started, but I learned that to set annotation scale in paperspace, you need to have the viewport currently selected, is there a way to have AutoCAD physically select an object so it is highlighted?, so I can run cannoscale and assign the proper scale to that viewport? Here is the code I have that doesnt work, but I figure it has to be close.
    Code:
    (defun c:annoscalematch (/        viewports     count
        vportcount    vport      vportheight
        vportdistance vportscale vportscale2
       )
      (if (and (equal (getvar "cannoscalevalue") 1.0 0.1)
        (wcmatch (getvar "dwgname") "RCp*")
          ) ;_ end of and
        (progn
          (setq viewports  (ssget "_X" '((0 . "VIEWPORT") (8 . "Viewport")))
         count      0
         vportcount (sslength viewports)
          ) ;_ end of setq
          (while (< count vportcount)
     (setq vport (ssname viewports count)
     ) ;_ end of setq
     (if (equal (cdr (assoc 40 (entget vport))) 30 0.1)
       (progn
       (setq
         vportheight
         (cdr (assoc 41 (entget vport)))
         vportdistance
         (cdr (assoc 45 (entget vport)))
         vportscale
         (/ 1 (/ vportheight vportdistance))
         vportscale2 (strcat "1:" (rtos vportscale 2 0))
       ) ;_ end of setq
       (setvar "cannoscale" vportscale2)
     ) ;_ end of if
     (setq count (1+ count))
     ) ;_ end of setq
          ) ;_ end of while
        ) ;_ end of progn
      ) ;_ end of if
    ) ;_ end of defun

  9. #9
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,104
    Login to Give a bone
    0

    Default Re: match annotation scale to viewport scale

    Good job on finding a start to this problem. You will need to adjust your cvport system variable to the current viewport you are working with in your selection set. However, if the cvport variable is equal to 1, meaning paperspace, AutoCAD does not allow changing it to a different space value. You will need to change to modelspace prior to changing each viewport's cannoscale.

    Try the following code
    Code:
    (defun c:annoscalematch	(/	    CVPORT     CVPRT	  TMODE
    			 VPANNOSCALE	       VPDIST	  VPHEIGHT
    			 VPID	    VPSCALE    VPWIDTH
    			)
      (if (wcmatch (getvar "dwgname") "RCp*")
        (progn
          (setq cvprt (getvar "cvport")
    	    tmode (getvar "tilemode")
          )
          (if (= 1 (setq tmode (getvar "tilemode")))
    	(setvar "tilemode" 0)
          )
          (if (/= 1 (setq cvprt (getvar "cvport")))
    	(setvar "cvport" 1)
          )
          (setq viewports (ssget "_X" '((0 . "VIEWPORT") (8 . "Viewport")))
    	    count     (sslength viewports)
          )
          (repeat count
    	(setq vport (entget (ssname viewports (setq count (1- count))))
    	      vpid  (cdr (assoc 69 vport))
    	)
    	(if (/= vpid 1)
    	  (progn
    	    (command "mspace")
    	    (setq vpwidth     (cdr (assoc 40 vport))
    		  vpheight    (cdr (assoc 41 vport))
    		  vpdist      (cdr (assoc 45 vport))
    		  vpscale     (/ 1 (/ vpheight vpdist))
    		  vpannoscale (strcat "1:" (rtos vpscale 2 0))
    	    )
    	    (setvar "cvport" vpid)
    	    (setvar "cannoscale" vpannoscale)
    	  )
    	)
          )
        )
      )
      (if (and (= cvport 1)
    	   (/= (getvar "cvport") cvport)
          )
        (command "pspace")
      )
      (if (/= tmode (getvar "tilemode"))
        (setvar "tilemode" tmode)
      )
      (princ)
    )
    I'm not sure on your limiting of viewport widths to only viewports with a width of 30. I have removed that check as many of my viewports are not that specific width. If you removed the check on the drawing name, this routine could also be used on more drawings.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  10. #10
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: match annotation scale to viewport scale

    I'll give it a shot. the reason I have the name check and the width is that I have it designed so when Eagle Point finishes creating the sheet, I can hopefully get it to automatically change the scale, with no user interaction. Like I said, I wil give it a try and see if I can get it to work.

    *edit - I have tried it and the only problem with it is that when it gets to the end, it doesnt switch back to paperspace, but after adding
    Code:
    (command "pspace")
    before the princ, it works perfect, thanks for the nudge in the right direction.
    Last edited by ccowgill; 2007-12-21 at 03:27 PM. Reason: tried it out

Page 1 of 4 1234 LastLast

Similar Threads

  1. Replies: 9
    Last Post: 2015-08-21, 06:33 PM
  2. match annotation scale to viewport scale
    By Mary_Ellen_Banning in forum AutoLISP
    Replies: 11
    Last Post: 2014-12-18, 03:20 AM
  3. Set Annotation Scale Equal to Viewport Scale
    By CADdancer in forum AutoLISP
    Replies: 2
    Last Post: 2009-10-09, 04:48 PM
  4. Annotation Scale different than Viewport scale!!
    By smooth shoes in forum AutoCAD General
    Replies: 1
    Last Post: 2008-10-17, 08:44 PM
  5. Replies: 0
    Last Post: 2006-11-28, 10:37 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
  •