Thursday, July 19, 2012

Making Tool Palette Hatches Annotative

Since tool palettes first came out, I've had a standing wish list item to make tool palette hatches annotative.  As far as I know, you can't.  So, as is done by many of you who read this blog, I had to come up with my own way.  Here's what I did.

First I wrote this simple LISP routine:

(defun AnnoHatch (HATCHPATTERN HATCHANGLE IMPSCALE HATCHLAYER)
  (setq CURDWGSCALE (getvar "CANNOSCALEVALUE"))
  (setq HATCHSCALE (rtoS(/ IMPSCALE CURDWGSCALE)))
  (setvar "CLAYER" HATCHLAYER)
  (command "-bhatch" "P" HATCHPATTERN HATCHSCALE HATCHANGLE "AN" "Y")
)

What it does is scripts the command line version of the BHATCH command by using the pattern (HATCHPATTERN), angle (HATCHANGLE), scale (IMPSCALE), and layer (HATCHLAYER) specified for the arguments.

Then, instead of hatch tools, I created command tools that ran this routine with the appropriate argument values for the hatch I was trying to create:

Now I can use the tool palette to create hatches that are annotative and work for whatever scale I happen to be in.

If you have a better way...please share.

4 comments:

  1. Thank you, this works excellent. I've already reconfigured my hatching palette and love it. I've been wanting this forever, I never thought of doing it this way.

    ReplyDelete
  2. You do not need a lisp. Just paste in the command string:

    ^C^C_-hatch;_p;AR-SAND;0.05;0;_co;252;_n;_an;_y;_dr;_b;_t;0

    ReplyDelete
  3. I've been using this for a while in 2011 with no problems and loving it's functionality. Now I'm switching to 2013 and it seems to be having some trouble, when inserting hatches it scales them by the annotative factor as well as makes them annotative. My demo hatching should come in at scale of 1 annotative 1:10, but it's coming in at scale of 10 annotative 1:10, hence 10 times larger than needed. Any ideas? Thanks.

    ReplyDelete
  4. I know it's an old thread but here's what I've found... Forget the lisp! Put all your desired hatches at the required scale. Drag them into your tool palette. Set HPANNOTATIVE to 1. Set you annotative scale. Click then hatch! This also works on LT.

    ReplyDelete