System variables and environment variables in AutoCAD

Source: Internet
Author: User

System variables and environment variables in AutoCAD (from the official Help file)

AboutSystem andEnvironment Variables(AutoLISP)(1)System VariablesAutoLISP applications can inspect and ChangeThe value of the AutoCAD system variables with theGetVar andSetvarfunctions.;; System variables are mainly related to AutoCAD. These functions use a string to specify the variable name. theSetvarfunctionrequires a second argument that specifies theNewvalue the system variable.AutoCAD System Variables Accept andreturn various data types:integers, reals, strings, 2D points, and3Dpoints.The data types of general system variables are: integers, floating-point numbers (reals), strings, 2D points, and 3D pointsValues supplied as arguments toSetvarmust be of the expectedtype. IfAn invalidtypeis supplied, a AutoLISP error is generated.Setvarparameter must be a data type that can be acceptedThe following example code demonstrates how to get andSetThe value of the AutoCADFilletradsystem Variable:(if( <(GetVar"Filletrad")1) (Setvar"Filletrad"1))(2)Environment VariablesAdditional functions,getenv andsetenv, provide AutoLISP routines with access to the currently defined operating system environment variables.; Environment variables are mainly related to the operating system. Two types of variables are not clearly categorized (perhaps I haven't found them yet). Unlike system variable names, environment variable names is case specific. For example, Maxhatch andMaxhatch is notThe same. When using thesetenvfunction, you always supply theNewvalue as a string evenifIt might be a numeric value. Unlike system variables, the environment variable name is case-sensitive and its value is always a string. Note that changes to Settings might notTake effect until the next TimeAutoCAD is started.settings on environment variables may not take effect immediately until AutoCAD restartsThe following example code demonstrates how toSetThe maxhatch environment variable:(setqCurmaxhatch(getenv"Maxhatch"))(prompt(strcat"\ncurrent Value of Maxhatch:"Curmaxhatch))(setenv"Maxhatch""50000")(prompt(strcat"\nnew Value of Maxhatch:"(getenv"Maxhatch")))(setenv"Maxhatch"Curmaxhatch)You can use the following methods to set up your environment:If you use command-line switches to specify environment settings, command-line switches override the settings specified in the Options dialog box or environment variables. if a command-line switch is not set, the corresponding value set in the Options dialog box is used. If neither the command-line switch nor the option value is set, the environment variable value is used. Note: command-line switches and environment variables override only the values set in the Options dialog box for the current task. They do not change the system registry.

In addition: according to the test, the user can add any name of the "environment variable", the data should be saved in the registry (the official document description is not found), the test is as follows:

$ (setenv "Vs\\boxtext-off" (RTOs Pi 2 2)) ;

"3.14"

$ (getenv "Vs\\boxtext-off");; " 3.14 "

System variables and environment variables in AutoCAD

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.