Jump to content

Recommended Posts

Posted

Hi all guys, 

Is there a way to get current system locate via autolisp? I need to read that from visual lisp.

thanks in advanced.

Screenshot (1416).png

Posted (edited)

Check the registry keys & descendents under:

HKEY_CURRENT_USER\Control Panel\International

 

Edited by Lee Mac
  • Like 1
Posted
3 hours ago, Lee Mac said:

Check the registry keys & descendents under:


HKEY_CURRENT_USER\Control Panel\International

 

Thank you lee mac, but this code not working :

 

(vl-registry-read
    "HKEY_CURRENT_USER\Control Panel\International"
  )

Posted (edited)
46 minutes ago, amir0914 said:

Thank you lee mac, but this code not working :

 

(vl-registry-read
    "HKEY_CURRENT_USER\Control Panel\International"
  )

 

That's not what I suggested, and you haven't escaped the backslashes.

 

Open regedit, browse to the location indicated, and examine the set of subkeys to understand which you require.

Edited by Lee Mac
  • Like 1
Posted

Thanks for spent time for my post, but i need to read this with autolisp functions, not manual

Posted
1 hour ago, amir0914 said:

Thanks for spent time for my post, but i need to read this with autolisp functions, not manual

 

That is not what @Lee Mac meant. You need to use regedit to find the name of the correct Key/Val pair. In my case this was "sCountry"

 

Then

(vl-registry-read "HKEY_CURRENT_USER\\Control Panel\\International" "sCountry")

Gave me United Kingdom

  • Like 1
Posted (edited)

Sorry lee mac, now I understand what you mean, but I couldn't find the key of system locate in "International" andو "sCountry" isn't what I need.

Edited by amir0914
Posted (edited)

Perhaps (getvar "Locale")? If what you are wanting is the Language, then The AutoCAD setting would be the same would it not?

 

In my system it is:

(vl-registry-read "HKEY_CURRENT_USER\\Control Panel\\International\\User Profile" "Languages")

EDIT or this?

(vl-registry-read "HKEY_CURRENT_USER\\Control Panel\\International\\" "LocaleName")

 

Edited by pkenewell
  • Like 1
Posted

Be careful but you can use regedit and search to find the answer. Mine returned Australia.

  • Like 1
Posted (edited)
On 3/9/2020 at 11:22 PM, pkenewell said:

Perhaps (getvar "Locale")? If what you are wanting is the Language, then The AutoCAD setting would be the same would it not?

 

In my system it is:


(vl-registry-read "HKEY_CURRENT_USER\\Control Panel\\International\\User Profile" "Languages")

EDIT or this?


(vl-registry-read "HKEY_CURRENT_USER\\Control Panel\\International\\" "LocaleName")

 

Thank you BIGAL, this code really helped me :

 

(vl-registry-read "HKEY_CURRENT_USER\\Control Panel\\International\\" "LocaleName")
Edited by amir0914
Posted

Yes returns true key value, "LocaleName" = en-au v's "sCountry" = Australia 

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...