0 Members and 1 Guest are viewing this topic.
RegistryEntries Element - Supported in AutoCAD 2015-based productsThe RegistryEntries element is optional, and can contain one or more RegistryEntry elements. A RegistryEntry element contains the definition of a registry entry that the plug-in should create or modify. Registry entries are stored in the Windows Registry or in a property list (PLIST) file on Mac OS.Note: On Windows, registry entries are created under HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\ <release>\ACAD- <product>: <language>. It is not possible to create registry entries in other locations. The equivalent location is used in the PLIST files on Mac OS....The following example creates the registry key MYREGKEY and adds the values STRING and NUMBER:Code - XML: [Select]<RegistryEntries> <RegistryEntry Key="MYREGKEY" Name="STRING" Value="Example" Type="REG_SZ" /> <RegistryEntry Key="MYREGKEY" Name="NUMBER" Value="123" Type="REG_DWORD" /></RegistryEntries> SystemVariables Element - Supported in AutoCAD 2015-based productsThe SystemVariables element is optional, and can contain one or more SystemVariables elements. A SystemVariable element contains the definition of a system variable that the plug-in should create or modify....The following example creates a system variable named MYVARIABLE:Code - XML: [Select]<SystemVariable Name="MYVARIABLE" PrimaryType="String" StorageType="User" Value="Example" Owner="" Flags="Create|DotIsEmpty|SpacesAllowed"/> The following example changes the value of the CURSORSIZE system variable to 100 when the plug-in is loaded the first time:Code - XML: [Select]<SystemVariable Name="CURSORSIZE" Value="100" Flags="OpenOnce"/> EnvironmentVariables Element - Supported in AutoCAD 2015-based productsThe EnvironmentVariables element is optional, and can contain one or more EnvironmentVariable elements. A EnvironmentVariable element contains the definition of an environment variable that the plug-in should create or modify. Environment variables are stored in the Windows Registry or in a property list (PLIST) file on Mac OS.Note: The value of an environment variable is always stored as a string, and the name of an environment variable is case sensitive....The following is an example of creating two environment variables named MYNUMVAR and MYSTRVAR:Code - XML: [Select]<EnvironmentVariables> <EnvironmentVariable Name="MYNUMVAR" Value="123" /> <EnvironmentVariable Name="MYSTRVAR" Value="Example" /></EnvironmentVariables> ...
so, one can create new setvars instead of being limited to the USER* system variables?
Storage location for the variable's value; when persisted. Optional when modifying an existing system variable.Valid values are:Database – Persisted in the drawing file the variable is createdProfile – Persisted as part of the current AutoCAD profileSession – Not retained between sessions or in the drawing it is createdUser – Persisted as part of the FixedProfile for AutoCAD
Command: (getvar 'prop1)"OFF"Command: (setvar 'prop1 "on")"on"Command: (getvar 'prop1)"on"
Nice! I've been doing this the hard way and just updating the registry directly. Thanks BlackBox.
The utter irony (I shouldn't have been surprised by), is that I happened to stumble upon it, searching Google for some old posts that demonstrate adding custom system variables via .NET Variables class to help here, instead of reading about it in an ADN email announcement, or even on DevBlog.
BlackBox_ wrote:** Note to self - Add poor code format available options (i.e., Lisp, .NET, XML, etc.) to list of new forum feedback. Grr.
Quote from: From over thereBlackBox_ wrote:** Note to self - Add poor code format available options (i.e., Lisp, .NET, XML, etc.) to list of new forum feedback. Grr.Good luck with that.