CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
Cesky English Deutsch
Login/Register:
 Visitors: 3034 
Plex.Earth connects AutoCAD and Google Earth

CAD tip CAD tip # 4241:

Question CAD 
 %  platform  category 
Q - question

How to lock given AutoCAD variables from editing?

A - answer The CADstudio SysVarLock reactor can keep AutoCAD variables from changing/setting their values. This application watches values of the defined variables and if the user attempts to change their value, that particular change is either allowed or denied - according to the pre-defined criteria (logical condition). If the condition is met, the change is allowed, otherwise it is locked-out. If you do not define such condition, the variable value is hard-locked.

With SysVarLock you can force users to keep certain AutoCAD settings enabled or disabled or limit values of certain variables.

So you can e.g. deny changes of the PICKADD variable, enforce using the 'internal' MText editor, not allow tracing, not allow switching off the Int osnap, etc.

The SysVarLock application can be downloaded on www.cadstudio.cz/download, see description and examples in the accompanying documentation (definition table, the SysVarLock command).


The definition table SysVarLock.tab defines the protection of given variables. See samples:

;format: ; "name-of-variable" test-expression ; ; parameters: ; - name of the variable to lock/keep ; - optional test expression: 'keep these values, disallow others' (expression in LISP syntax) ; ; variable is not changed when test-expresion evaluates to FALSE/nil ; the '?' character is a placeholder for the current value of the variable ; make sure you use the same data-type as the watched variable in your expressions (string, number) ; ; examples: ; "MIRRTEXT" nil --- never change MIRRTEXT (simple format) ; "PICKADD" --- never change PICKADD (even simpler format) ; "UCSFOLLOW" (= ? 0) --- never set UCSFOLLOW to 1 ; "AUTOSNAP" (< ? 8) --- Autosnap must be always <8 (no polar tracking) ; "MTEXTED" (or (= ? "Vnitřní")(= ? "Internal")) --- allow only internal MTeditor ; "CECOLOR" (< ? 10) --- don't use subtle color hues (only the basic colors) ; "FONTALT" (>= (strlen ?) 5) --- alt.font filename must be at least 5 chars long ; "DONUTOD" (> (+ (getvar"DONUTID") 1) ?) --- donuts must have outer diameter at... ; "DONUTID" (< (+ (getvar"DONUTOD") 1) ?) --- ...least 1 unit larger than inner dia ; "OSMODE" (zerop (logand ? 8)) --- don't allow to set the NODe osnap ; "OSMODE" (zerop (logand ? 128)) --- don't allow setting the PER osnap ; "OSMODE" (/= (logand ? 33) 0) --- don't allow to switch off both the INT and END osnaps ; "LUNITS" (= ? 2) --- don't allow to switch to other units than Decimal ; "BLOCKEDITORLOCK" (= ? 1) --- keep Dynamic Block Editor locked (dblclick=refedit)
ACADMapADT
100% *  CAD 
21.2.2005    30081x  
Comments   Tell a friend

See also:
Tip 11171:Total number of layouts as a field.
Tip 10763:How to block specific AutoCAD commands?
Tip 10702:How to find which AutoCAD version was used to save a particular DWG drawing?
Tip 9514:Automatically set the Author property in DWG files.
Tip 9428:Save DWG drawing automatically after every N commands.


Back   All CAD Tips All CAD tips&tricks

What is the ANSYS.EXE process running in Inventor? « | » Replacing TrueType fonts in an opened .DWG file with faster SHX fonts.

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   



Featuring:
Increase your productivity with our set of add-on functions for AutoCAD Civil 3D
CADstudio Civil Tools More info


Please use these tips at your own risk.
CAD Studio (Xanadu) is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist