Results 1 to 10 of 10

Thread: Annotation scales to list Change annotation scale from paperspace

  1. #1
    Member jozakin's Avatar
    Join Date
    2010-04
    Posts
    40
    Login to Give a bone
    0

    Default Annotation scales to list. Change annotation scale from paperspace

    Hello,

    First question: How do i change annotation scale from paper space?

    I get following error:
    Cannot set CANNOSCALE to that value.

    Second question: How can i check if the annotation scale i want to add already exists?

    Example i want to check if 1:50 exists if it does no action needed else scale 1:50 must be added to scale-list
    Last edited by jozakin; 2010-11-24 at 01:22 PM.

  2. #2
    Certifiable AUGI Addict irneb's Avatar
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Annotation scales to list Change annotation scale from paperspace

    Look at some of the functions in the attached.
    Attached Files Attached Files
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  3. #3
    Member jozakin's Avatar
    Join Date
    2010-04
    Posts
    40
    Login to Give a bone
    0

    Default Re: Annotation scales to list Change annotation scale from paperspace

    Thank you Irneb

    I think ill sort out the second question without to many difficulty's thx to u.

    The first one remains

    Gr

  4. #4
    AUGI Addict alanjt's Avatar
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: Annotation scales to list Change annotation scale from paperspace

    Using the sub, you could do something like this to display a nice sorted list.

    sub:
    Code:
    ;; Function to obtain list of scale entity names
    (defun GetScaleListEntities (/ lst item)
      (setq lst nil)
      (foreach item    (dictsearch (namedobjdict) "ACAD_SCALELIST")
        (if    (= 350 (car item))
          (setq lst (cons (cdr item) lst))
        ) ;_ end of if
      ) ;_ end of foreach
      lst
    ) ;_ end of defun
    Sub to sort and return names:
    Code:
    (defun _SortedScaleList (lst)
      ;; Alan J. Thompson, 11.24.10
      (if lst
        (vl-sort
          (mapcar (function (lambda (x) (cdr (assoc 300 (entget x))))) lst)
          (function (lambda (a b / f)
                      (defun f (s / m l)
                        (if (setq m (cdr (cond ((member 61 (setq l (vl-remove 32 (vl-string->list s)))))
                                               ((member 58 l))
                                         )
                                    )
                            )
                          (atof (vl-list->string m))
                          (atof s)
                        )
                      )
                      (< (f a) (f b))
                    )
          )
        )
      )
    )
    eg.
    Code:
    (_SortedScaleList (GetScaleListEntities))
    Just playing around.
    Civil 3D 2017 ~ Windohz 7
    Dropbox

  5. #5
    Member jozakin's Avatar
    Join Date
    2010-04
    Posts
    40
    Login to Give a bone
    0

    Default Re: Annotation scales to list Change annotation scale from paperspace

    Thats nice!

    For the cannoscale in paperspace subject. I should explain myself a litle bit more. We currently use useri1 as a variable to save the scale.
    This was implented long before i used autocad
    Now what i want is that when u open a drawing it automaticly sets the annoscale to the useri1 variable.
    The problem is when u save the drawing in paperspace and open it afterwards u get the error because the drawing opens in paperspace.
    I could temporarly switch to model but that can be bulky if u have a large drawing.
    So i want to set the modelspace annoscale while i am in paperspace.

  6. #6
    AUGI Addict alanjt's Avatar
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: Annotation scales to list Change annotation scale from paperspace

    Quote Originally Posted by jozakin View Post
    Thats nice!

    For the cannoscale in paperspace subject. I should explain myself a litle bit more. We currently use useri1 as a variable to save the scale.
    This was implented long before i used autocad
    Now what i want is that when u open a drawing it automaticly sets the annoscale to the useri1 variable.
    The problem is when u save the drawing in paperspace and open it afterwards u get the error because the drawing opens in paperspace.
    I could temporarly switch to model but that can be bulky if u have a large drawing.
    So i want to set the modelspace annoscale while i am in paperspace.
    Thanks. I was just playing around.

    I'm confused, the annotation scale isn't changed upon opening the drawing; why would you need to reset it upon each open?
    Civil 3D 2017 ~ Windohz 7
    Dropbox

  7. #7
    Member jozakin's Avatar
    Join Date
    2010-04
    Posts
    40
    Login to Give a bone
    0

    Default Re: Annotation scales to list Change annotation scale from paperspace

    Hi,

    This is because some of our senior drafters aren't familiar with the annotation scale stuff.
    To make the switch hassle free i would like to set the annotation scale to the useri1 variable so when they insert for example an anno block it will be at the right scale right away (before the useri1 was used now the cannoscalevalue) .

    Hope this explains the problem a bit.

    Greets from Belgium

  8. #8
    Certifiable AUGI Addict irneb's Avatar
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Annotation scales to list Change annotation scale from paperspace

    I simply cannot find a way of obtaining the CAnnoScale of any VP (be it one of those on a PS tab, or the VP of MS) or any of the Block definitions / Block TableRecord, or even Layouts of any tab (including Model). None of them have any such property in ActiveX, neither do they link to extension dictionaries as the ObjectScale is applied to entities.

    So I think your only option would be to step through each tab, and into each VP and set the CAnnoScale for each. Otherwise you might be able to modify it programatically through DotNet / ARX. But it certainly isn't possible to even view it through ActiveX or DXF - only through getvar / setvar.
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  9. #9
    Member jozakin's Avatar
    Join Date
    2010-04
    Posts
    40
    Login to Give a bone
    0

    Default Re: Annotation scales to list Change annotation scale from paperspace

    Quote Originally Posted by irneb View Post
    I simply cannot find a way of obtaining the CAnnoScale of any VP (be it one of those on a PS tab, or the VP of MS) or any of the Block definitions / Block TableRecord, or even Layouts of any tab (including Model). None of them have any such property in ActiveX, neither do they link to extension dictionaries as the ObjectScale is applied to entities.

    So I think your only option would be to step through each tab, and into each VP and set the CAnnoScale for each. Otherwise you might be able to modify it programatically through DotNet / ARX. But it certainly isn't possible to even view it through ActiveX or DXF - only through getvar / setvar.
    Thx for the replies.
    I really appreciate your input.

    code i use to check scales:
    Code:
    (defun setschaal ( / schaalold)
    (if (not (inPspace))
    (progn
    (if	(= (getvar "useri1") 0)
    (setq schaalold "1:1")
    (setq schaalold (strcat "1:"(itoa(getvar "useri1"))))
    )
    (if(member schaalold (_SortedScaleList (GetScaleListEntities)))
      (progn (setvar "CANNOSCALE" schaalold))
      (progn (command "-scalelistedit" "a" schaalold schaalold "e")(setvar "CANNOSCALE" schaalold))
    )
    )
    )
    )

  10. #10
    Certifiable AUGI Addict irneb's Avatar
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Annotation scales to list Change annotation scale from paperspace

    That should work fine as long as your CTab="Model". The Paper Space tabs should nearly always have a CAnnoScale="1:1".
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

Similar Threads

  1. Purge Annotation Scales That Are Not the Current Active Annotation Scale
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2009-02-01, 06:04 PM
  2. annotation scale list
    By kmf2797 in forum AMEP General
    Replies: 3
    Last Post: 2008-08-21, 03:12 PM
  3. Annotation Scale list keeps propagating the whole list
    By jacep in forum AutoCAD Annotation
    Replies: 16
    Last Post: 2007-12-13, 06:24 PM
  4. Replies: 6
    Last Post: 2007-05-24, 08:44 PM
  5. AutoCAD 2008 Delete scale from Annotation Scale list
    By cgerhardt in forum VBA/COM Interop
    Replies: 3
    Last Post: 2007-04-25, 02:21 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
  •