Jump to content

Lisp code to set the HPMAXAREAS variable.


Recommended Posts

Posted

When I run the following autolisp line of code I get the following message:

 

Program ERROR: AutoCAD variable setting rejected: "HPMAXAREAS" 0

 

 (setvar "HPMAXAREAS" 0)

 

1. Setting the HPMAXAREAS system variable to 0 sets the hatch pattern back to the legacy setting.

2. I can change the value from the command line, either by typing the variable name HPMAXAREAS or through the AutoCAD setvar command.

3. Best I can tell, the variable HPMAXAREAS is an integer and is not read only.

4. The lisp code does not work in modespace or paperspace.

 

Thank you for any suggestions.

Posted

The help says the variable is saved in the registry maybe change it there have to find it first search here for registry will give lisp code to do and need to use regedit to find BUT BE CAREFULL yep set to 100

Posted

I think I answered my own question.

 

For whatever reason, the "setvar" lisp command does not seem to work with the HPMAXAREAS variable, but I was able to use AutoLISP "command" function instead.

 

(setq hpmax (getvar "hpmaxareas")     ;obtain initial value: default 100
(command "setvar" "hpmaxareas" 0)     ;set the system variable to 0
         [program code]
(command "setvar" "hpmaxareas" hpmax) ;reset system variable to original

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...