Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 34

Thread: match annotation scale to viewport scale

  1. #21
    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

    ; error: bad argument type: consp "*A1"

    is the error I get when I run the program. Also you have a call for a
    GetDictKeyVals command, but I changed it to GetDictKeys to match the defun in the program

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

    Default Re: match annotation scale to viewport scale

    Quote Originally Posted by ccowgill View Post
    ; error: bad argument type: consp "*A1"

    is the error I get when I run the program. Also you have a call for a
    GetDictKeyVals command, but I changed it to GetDictKeys to match the defun in the program
    Replace it with this.
    Code:
    Code removed
    Last edited by Opie; 2008-02-18 at 06:29 PM. Reason: Removed code
    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

  3. #23
    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

    after I ran the code, I found that it is something similar to what I already have, it changes the name in the annotation scale of the 1:1 scale to 1:40, giving me 2 1:40 scales, this messes something else up, I just cant remember what it was. I think that the scaled objects still do not show properly.

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

    Default Re: match annotation scale to viewport scale

    Quote Originally Posted by ccowgill View Post
    after I ran the code, I found that it is something similar to what I already have, it changes the name in the annotation scale of the 1:1 scale to 1:40, giving me 2 1:40 scales, this messes something else up, I just cant remember what it was. I think that the scaled objects still do not show properly.
    Disregard that last code. You are correct in that it renames the scale of the original annotation scale to a new name.

    I have discovered that each scale has it's own entity name. I just have not discovered how to make the viewport be associated with that new scale. The original routine is the only way that I have found to make it work.

    I'll keep working on it as I have time.
    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

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

    Default Re: match annotation scale to viewport scale

    The annotation scale of a viewport seems to only be possible to change while inside the viewport, by setting CANNOSCALE. I've tried modifying the Extension Dictionary which links the viewport to the Scale object - but it simply doesn't have any effect.

    So finally I've just made a lisp to go into each viewport selected and set its CANNOSCALE to that matching the viewport's zoom factor (as close as possible). Commands are MatchVPScale & MatchAllVPScale.
    Attached Files Attached Files

  6. #26
    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 that a shot and see if it works for my situation, It's been a while but I believe I was hoping to run it from a reactor, or within another program.

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

    Default Re: match annotation scale to viewport scale

    Quote Originally Posted by ccowgill View Post
    I'll give that a shot and see if it works for my situation, It's been a while but I believe I was hoping to run it from a reactor, or within another program.
    From my code you could try to call the helper function SetVPAnnoScale by passing it the ename of the viewport entity and the zoom ratio (which you can get using the CustomScale property or use my helper func GetVPScale with a normal ename as parameter). Otherwise just call the MatchVPScale command & select the relevant VP through VBA.

  8. #28
    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 irneb View Post
    From my code you could try to call the helper function SetVPAnnoScale by passing it the ename of the viewport entity and the zoom ratio (which you can get using the CustomScale property or use my helper func GetVPScale with a normal ename as parameter). Otherwise just call the MatchVPScale command & select the relevant VP through VBA.
    I know it's been a while, but I was going through my subscribed threads and noticed that I havent responded to this one.

    Can I just have your program run on all the viewports in the current drawing? the goal is that when we run our clean up routine after a sheet is created by our 3rd party software, that the 2 viewports created get an annotation scale set to match the scale of the viewport.

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

    Default Re: match annotation scale to viewport scale

    Sure that's what the MatchAllVPScale command is for, it matches the CANNOSCALE to the VPScale for all viewports on all layouts in the current drawing. If you want to call it from a reactor, (c:MatchAllVPScale). Just be careful what reaction to place it under, so you don't end up with the routine causing the reaction again & thus causing an infinite loop. If this happens, maybe add a global state variable, set it to T just before calling the (c:MatchAllVPScale) then set it back to nil just after. Only run the routine if it's not set to T. Something like
    Code:
    (if (not alreadyrunning)
      (progn
        (setq alreadyrunning T)
        (c:MatchAllVPScale)
        (setq alreadyrunning nil)
      )
    )

  10. #30
    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

    that seems to have gotten the job done, I just attached it to our clean up file, so when it is run, the scales are matched.

Page 3 of 4 FirstFirst 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
  •