Problem redefining hatch command

Problem redefining hatch command

KeithSWD
Advocate Advocate
344 Views
1 Reply
Message 1 of 2

Problem redefining hatch command

KeithSWD
Advocate
Advocate

I have the following lines in a lisp routine which I load with Startup Suite. I want to redefine the hatch command to ensure hatch associativity is selected by default:

 

(defun c:hatch ()
(if (= (getvar “hpassoc”) 0)
(setvar “hpassoc” 1)
)
(command “.hatch”)
)


(command “undefine” “hatch”)

 

It doesn't seem to be working, and undefining 'HATCH' seems to break the 'h' keyboard shortcut defined in the PGP file, so that "h" brings up HALOGAP.

I've tried putting the "undefine" both before and after the replacement hatch function, but it doesn't seem to make any difference.

 

Not sure what I am doing wrong...?

 

thanks in advance

0 Likes
345 Views
1 Reply
Reply (1)
Message 2 of 2

maxim_k
Consultant
Consultant

Hi,

 

I think you don't need to redefine HATCH command.

Try this:

 

(defun c:H ()
(if (= (getvar "hpassoc") 0)
(setvar "hpassoc" 1)
)
(initdia)
(command "._HATCH")
)

 

I added (initdia) function call in order to show Hatch Visor, without it you should work with hatch options only via command prompt.

 

Maxim


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes