Adjust Display Scale of Lineweight Settings dialog... again

Discussion in 'AutoCAD' started by Maksim Sestic, Jun 3, 2004.

  1. Me again, with my Display Scale Adjusting quiz...

    The question was - how do I programatically, by any means, change the value of Adjust Display Scale slider in Lineweight Settings dialog?

    Bill and Tony replied that there's a registry entry:
    HKEY_CURRENT_USER/Autodesk/AutoCAD/VERSION/FLAVOUR/Profiles/PROFILE/General/LineWeightDisplayScale
    that keeps track of the value. Alas, I tried to set it up in various ways, but the lineweight display scale stays the same on the screen (regen doesn't help). I even tried to set it (to DWORD 4) and then create new ACAD profile using existing settings, but the newly created profile just somehow continues to keep the original settings.

    As far as I see, I'll have to implement VBA sub that launches Lineweight Settings dialog, then searches for the dialog via API, finds the slider control inside it moving it to desired value somehow... (setting focus and playing a sendkey sequence)... Oh no...

    Thanks for any tip on this.

    Regards,
    Maksim Sestic
     
    Maksim Sestic, Jun 3, 2004
    #1
  2. You must be doing something wrong.

    AutoCAD reads the registry for that value
    before displaying the dialog box.

    What I haven't checked is if the value is kept
    and updated in memory during the acad session
    but I doubt it.

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

    Me again, with my Display Scale Adjusting quiz...

    The question was - how do I programatically, by any means, change the value of Adjust Display Scale slider in Lineweight Settings dialog?

    Bill and Tony replied that there's a registry entry:
    HKEY_CURRENT_USER/Autodesk/AutoCAD/VERSION/FLAVOUR/Profiles/PROFILE/General/LineWeightDisplayScale
    that keeps track of the value. Alas, I tried to set it up in various ways, but the lineweight display scale stays the same on the screen (regen doesn't help). I even tried to set it (to DWORD 4) and then create new ACAD profile using existing settings, but the newly created profile just somehow continues to keep the original settings.

    As far as I see, I'll have to implement VBA sub that launches Lineweight Settings dialog, then searches for the dialog via API, finds the slider control inside it moving it to desired value somehow... (setting focus and playing a sendkey sequence)... Oh no...

    Thanks for any tip on this.

    Regards,
    Maksim Sestic
     
    Jorge Jimenez, Jun 3, 2004
    #2
  3. Jorge,

    This is what I tried till now:

    First check for existance of LineWeightDisplayScale registry value of "General" key within current profile. If there's no such value (originally there's none), I create it and set it to DWORD 4 (only that value works for me). So, here's what I did then...

    1) If reg. key exists, I change the registry value from hex 1C (original setting) to 4 (DWORD). Nothing happens within drawing, display scale stays the same. It's still 1C when I open the dialog again using "lweight". Regen doesn't help. When I recheck the registry value, it's 4 (as it should be). Dialog simply ignores my manual registry setting.

    2) Change registry value, shut down the ACAD. When I reopen ACAD, nothing happens (!) - even when there's correct value stored in registry.

    My conclusion - there must be some other (registry or .ini based) value that also keeps track of LineWeightDisplayScale setting. BTW, there're no code flaws and explicit + debugging are on.

    Please help, it drives me nuts.

    Regards,
    Maksim Sestic


    You must be doing something wrong.

    AutoCAD reads the registry for that value
    before displaying the dialog box.

    What I haven't checked is if the value is kept
    and updated in memory during the acad session
    but I doubt it.

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

    Me again, with my Display Scale Adjusting quiz...

    The question was - how do I programatically, by any means, change the value of Adjust Display Scale slider in Lineweight Settings dialog?

    Bill and Tony replied that there's a registry entry:
    HKEY_CURRENT_USER/Autodesk/AutoCAD/VERSION/FLAVOUR/Profiles/PROFILE/General/LineWeightDisplayScale
    that keeps track of the value. Alas, I tried to set it up in various ways, but the lineweight display scale stays the same on the screen (regen doesn't help). I even tried to set it (to DWORD 4) and then create new ACAD profile using existing settings, but the newly created profile just somehow continues to keep the original settings.

    As far as I see, I'll have to implement VBA sub that launches Lineweight Settings dialog, then searches for the dialog via API, finds the slider control inside it moving it to desired value somehow... (setting focus and playing a sendkey sequence)... Oh no...

    Thanks for any tip on this.

    Regards,
    Maksim Sestic
     
    Maksim Sestic, Jun 5, 2004
    #3
  4. Have you tried doing that manually ???

    If you shut down AutoCAD and change
    the registry value to 2, then open
    AutoCAD, you should get the lowest
    value on the displayscale bar. If you don't
    then you're changing the wrong key.
    A value of 4 should display the second notch
    on the displayscale bar.

    Like I said before I haven't tested if the
    value is cached and not read until the
    next session, but if you're changing the
    value while AutoCAD is running and nothing
    happens, then ACAD reads the value only
    once, and writes the final value when closing
    the session.

    There are temporary values that are added to
    the registry when this dialog box is open and
    closed. When the acad session is closed, those
    values are deleted. You should check to see if
    one of those values is a temporary storage
    for the displayscale.

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

    Jorge,

    This is what I tried till now:

    First check for existance of LineWeightDisplayScale registry value of "General" key within current profile. If there's no such value (originally there's none), I create it and set it to DWORD 4 (only that value works for me). So, here's what I did then...

    1) If reg. key exists, I change the registry value from hex 1C (original setting) to 4 (DWORD). Nothing happens within drawing, display scale stays the same. It's still 1C when I open the dialog again using "lweight". Regen doesn't help. When I recheck the registry value, it's 4 (as it should be). Dialog simply ignores my manual registry setting.

    2) Change registry value, shut down the ACAD. When I reopen ACAD, nothing happens (!) - even when there's correct value stored in registry.

    My conclusion - there must be some other (registry or .ini based) value that also keeps track of LineWeightDisplayScale setting. BTW, there're no code flaws and explicit + debugging are on.

    Please help, it drives me nuts.

    Regards,
    Maksim Sestic


    You must be doing something wrong.

    AutoCAD reads the registry for that value
    before displaying the dialog box.

    What I haven't checked is if the value is kept
    and updated in memory during the acad session
    but I doubt it.

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

    Me again, with my Display Scale Adjusting quiz...

    The question was - how do I programatically, by any means, change the value of Adjust Display Scale slider in Lineweight Settings dialog?

    Bill and Tony replied that there's a registry entry:
    HKEY_CURRENT_USER/Autodesk/AutoCAD/VERSION/FLAVOUR/Profiles/PROFILE/General/LineWeightDisplayScale
    that keeps track of the value. Alas, I tried to set it up in various ways, but the lineweight display scale stays the same on the screen (regen doesn't help). I even tried to set it (to DWORD 4) and then create new ACAD profile using existing settings, but the newly created profile just somehow continues to keep the original settings.

    As far as I see, I'll have to implement VBA sub that launches Lineweight Settings dialog, then searches for the dialog via API, finds the slider control inside it moving it to desired value somehow... (setting focus and playing a sendkey sequence)... Oh no...

    Thanks for any tip on this.

    Regards,
    Maksim Sestic
     
    Jorge Jimenez, Jun 7, 2004
    #4
  5. Jorge,

    It was so obvious and you're right - ACAD reads the display scale setting at the moment it's fired up for the first time. Then it keeps the slider's setting in some temp variable and writes it back to the registry as the user either shuts down the ACAD or switches to some other profile.

    Funny thing is that I coded the registry checkup/change as the ACAD is already up and running (though it's invisible to the user and in zero document state). Alas, at that point the registry value is already "read" and stored to that nasty temporary var. I just re-coded the part "what happens when" and it's working fine now :)

    Thanks again,
    Maksim Sestic
    Have you tried doing that manually ???

    If you shut down AutoCAD and change
    the registry value to 2, then open
    AutoCAD, you should get the lowest
    value on the displayscale bar. If you don't
    then you're changing the wrong key.
    A value of 4 should display the second notch
    on the displayscale bar.

    Like I said before I haven't tested if the
    value is cached and not read until the
    next session, but if you're changing the
    value while AutoCAD is running and nothing
    happens, then ACAD reads the value only
    once, and writes the final value when closing
    the session.

    There are temporary values that are added to
    the registry when this dialog box is open and
    closed. When the acad session is closed, those
    values are deleted. You should check to see if
    one of those values is a temporary storage
    for the displayscale.

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

    Jorge,

    This is what I tried till now:

    First check for existance of LineWeightDisplayScale registry value of "General" key within current profile. If there's no such value (originally there's none), I create it and set it to DWORD 4 (only that value works for me). So, here's what I did then...

    1) If reg. key exists, I change the registry value from hex 1C (original setting) to 4 (DWORD). Nothing happens within drawing, display scale stays the same. It's still 1C when I open the dialog again using "lweight". Regen doesn't help. When I recheck the registry value, it's 4 (as it should be). Dialog simply ignores my manual registry setting.

    2) Change registry value, shut down the ACAD. When I reopen ACAD, nothing happens (!) - even when there's correct value stored in registry.

    My conclusion - there must be some other (registry or .ini based) value that also keeps track of LineWeightDisplayScale setting. BTW, there're no code flaws and explicit + debugging are on.

    Please help, it drives me nuts.

    Regards,
    Maksim Sestic


    You must be doing something wrong.

    AutoCAD reads the registry for that value
    before displaying the dialog box.

    What I haven't checked is if the value is kept
    and updated in memory during the acad session
    but I doubt it.

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

    Me again, with my Display Scale Adjusting quiz...

    The question was - how do I programatically, by any means, change the value of Adjust Display Scale slider in Lineweight Settings dialog?

    Bill and Tony replied that there's a registry entry:
    HKEY_CURRENT_USER/Autodesk/AutoCAD/VERSION/FLAVOUR/Profiles/PROFILE/General/LineWeightDisplayScale
    that keeps track of the value. Alas, I tried to set it up in various ways, but the lineweight display scale stays the same on the screen (regen doesn't help). I even tried to set it (to DWORD 4) and then create new ACAD profile using existing settings, but the newly created profile just somehow continues to keep the original settings.

    As far as I see, I'll have to implement VBA sub that launches Lineweight Settings dialog, then searches for the dialog via API, finds the slider control inside it moving it to desired value somehow... (setting focus and playing a sendkey sequence)... Oh no...

    Thanks for any tip on this.

    Regards,
    Maksim Sestic
     
    Maksim Sestic, Jun 8, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.