See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Dimension style text color not updating after AutoLisp script

  1. #1
    Member
    Join Date
    2006-08
    Posts
    38
    Login to Give a bone
    0

    Angry Dimension style text color not updating after AutoLisp script

    Hi all,

    I have previously opened a thread in the programming section of AutoLisp for creating a script that would change all my current dimension style text color from yellow (which is unprintable) to white. The initial thread is located here: http://forums.augi.com/showthread.php?p=731005

    I have managed to create a script that changes the DXF group code for what I am looking to achieve which is the DIMCLRT attribute of a dimension style.

    The problem is that AutoCAD doesn't update the drawing with the new attribute, so the text stays white although the dimension style attribute dialog boxes clearly state that the color should be white.

    When updating the color using the "dimstyle" command that opens the dialog box for editing these attributes, it works, autocad applies the new changes. But it doesn't care about my autolisp code.

    I am wondering if anyone in here has had problem with that kind of stuff. Do you think there is an option somewhere to apply the autolisp attributes?

    I tried regen, redraw, saving and reopening the dwg, restarting autocad, but they all didn't work.

    So if anyone has an idea, then he is gratefully welcomed.

  2. #2
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Dimension style text color not updating after AutoLisp script

    Hi Thomas.
    First, I must say that your requests would be easier to follow if they were separated as one thread per question (or one question per thread)..

    Next - re "time r" - try a blank line before "Box ......" to terminate the time command.

    Then - have you tried the command "Dim - Update - All" (you'll have to format that correctly) after the colour change?

  3. #3
    Member
    Join Date
    2006-08
    Posts
    38
    Login to Give a bone
    0

    Default Re: Dimension style text color not updating after AutoLisp script

    Hi jaberwork,

    You are probably right about having 2 threads about the same issue. I will ask to have that one locked.

    What you have told me to try has spotted one of problem. I will discuss it in my other initial thread.

    For those interested in the outcome of that problem, see you in: http://forums.augi.com/showthread.php?t=64308

  4. #4
    Member
    Join Date
    2006-08
    Posts
    38
    Login to Give a bone
    0

    Default Re: Dimension style text color not updating after AutoLisp script

    Do you have any idea how to write the equivalent lisp code to: "Dimension > Update > All"

    I tried:
    Code:
    (command "._DIMENSION" "update" "all" "")
    And of course it didn't work, that would have been too easy...

  5. #5
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    1

    Default Re: Dimension style text color not updating after AutoLisp script

    Quote Originally Posted by thomas.glasgow
    Do you have any idea how to write the equivalent lisp code to: "Dimension > Update > All"

    I tried:
    Code:
    (command "._DIMENSION" "update" "all" "")
    And of course it didn't work, that would have been too easy...
    Try
    Code:
    (command "._DIM1" "update" "all" "")
    edit - believe it or not, DIMENSION isn't an acad command.

  6. #6
    Member
    Join Date
    2006-08
    Posts
    38
    Login to Give a bone
    0

    Thumbs up Re: Dimension style text color not updating after AutoLisp script

    Man! It worked! You are a hero!

    Please make three wishes, and I will grant you your wishes my Autolisp Grand Master of the Light Force!

    EDIT: where did you find about DIM1, I can't find it anywhere in any help file of any kind...

    EDIT2: actually it is in the autocad help, I didn't spot it earlier because it should have been written even smaller than it is now
    Last edited by thomas.glasgow; 2007-07-16 at 08:14 PM.

  7. #7
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Dimension style text color not updating after AutoLisp script

    I'm just glad it worked.

  8. #8
    Member
    Join Date
    2006-08
    Posts
    38
    Login to Give a bone
    0

    Default Re: Dimension style text color not updating after AutoLisp script

    Little update:

    Actually it fired back at me! When a dimension style has an override, issuing the DIM1 command deletes the override

    And that's a massive problem, as some of my dimension style have a scale factor override.

  9. #9
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Dimension style text color not updating after AutoLisp script

    Quote Originally Posted by thomas.glasgow
    Little update:

    Actually it fired back at me! When a dimension style has an override, issuing the DIM1 command deletes the override

    And that's a massive problem, as some of my dimension style have a scale factor override.

    IMO - Never Use Overrides! Use Styles.

  10. #10
    Member
    Join Date
    2006-08
    Posts
    38
    Login to Give a bone
    0

    Default Re: Dimension style text color not updating after AutoLisp script

    Agreed, however I have no choice. These are drawings supplied by my customers, and they used overrides. It seems that they come from Autocad Mechanical and that's what is causing the trouble. You know like the $10a52az3s automatic block naming that comes from mechanical as well.

    By the way I have a strange behavior that I had never spotted before: here is a complete drawing, so there is only that little pin and a few dimensions on it. How is it possible to have more dimstyles than there are dimensions??? "purge" doesn't get rid of them, is there a way to completely clean the unnecessary dimstyles? Actually only 08 is used.

    EDIT: when I try ti delete the other dimstyles, AutoCAD tells me that they are in use?! Cool, but he doesn't tell me by whom. Where can I find that info?


    Last edited by thomas.glasgow; 2007-07-17 at 01:05 PM.

Page 1 of 2 12 LastLast

Similar Threads

  1. Setting up a Dimension style from a script file via a Tool Palette
    By kgodfrey in forum AutoCAD Customization
    Replies: 3
    Last Post: 2013-09-08, 09:10 PM
  2. Replies: 3
    Last Post: 2012-12-19, 03:00 PM
  3. Dimension Text Override with Autolisp
    By CADdancer in forum AutoLISP
    Replies: 3
    Last Post: 2005-07-12, 05:33 PM
  4. Script File - Text Style
    By ablair.69905 in forum AutoCAD Customization
    Replies: 2
    Last Post: 2004-11-03, 05:17 PM
  5. Changing text height and style in AutoLISP
    By ahipkin60511 in forum AutoLISP
    Replies: 7
    Last Post: 2004-07-19, 08:13 AM

Posting Permissions

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