Jump to content

LISP to get past the "Dense Hatch Pattern" Dialog Box


rayg11757

Recommended Posts

I wrote a LISP program that works in AutoCAD 2006, but is not working properly in AutoCAD 2013. Part of the program creates a hatch using the standard AutoCAD “Line”pattern, where the hatch scale is very small. The small hatch scale is required for doing numerical integration using the high-density hatch lines.

 

Presently, the program runs on AutoCAD 2013 only when the hatch scale is set to 0.10 or more; but when the hatch scale is set to 0.01 or smaller, the hatch is not drawn and the LISP program bombs. Based on my research, I have set the MaxHatch variable to a very high value, (setenv "MaxHatch" "1000000"), but the LISP program still bombs below the same 0.10 hatch scale.

 

Interestingly, when the hatch command is started from the command prompt, I can set the hatch scale to 0.0001 and although a “Dense Hatch Pattern” dialog box appears, the very fine hatch is drawn after selecting the option: “Create a dense hatch pattern (not recommended).”

 

Is there any way to bypass this “Dense Hatch” dialog box using LISP Code so that a very fine hatch is created directly from the LISP code?

 

Thank you for your help.

Ray

 

 
(command "-LAYER" "N" "sp-Hatching" "C" "YELLOW" "sp-Hatching" ""
"-HATCH" "Properties" "*LINE" hatchsc "0" "Select" selset "" ""
"-LAYER" "OFF" "*" "N" "")

Hatch-Dense.jpg

Edited by rayg11757
Link to comment
Share on other sites

SLW - Sorry about that... I knew better and it won't happen again. I edited the post.

 

GP - Thanks so much for the suggestion. Worked GREAT!!!!!!!!

Thank you very much,

Ray

Link to comment
Share on other sites

Next Problem: GP's suggestion worked great for creating a very dense hatch. In my original lisp program, the hatch used the *Line where the "*" inserted an exploded hatch. I need the hatch exploded so I can obtain the start and end points of each line. Now, however, when I explode the very dense hatch, the lines all disappear. The hatch is gone even with all layers "on" and "zoom all." If I change the hatch scaling to a larger number, the hatch explodes just fine. I tried the burst command, but it did not work.

 

Is there a way to explode a dense hatch without the hatch being deleted by AutoCAD?

 

Ultimately I need the individual lines, and I know there will be many. Exploding a dense hatch was not a problem in 2006, so I'm wondering what I doing wrong with AutoCAD 2013. My experience is that AutoDesk is pretty good at leaving previous functionality intact.

Thank you - Ray

Link to comment
Share on other sites

GP- Between you and praying, this suggestion helped quite a bit!!!!

 

Changing the system variable HPMAXAREAS = 0 seems to have allowed the hatch density to increase significantly to a level that is functional and accurate enough for my purposes, (although If I could make the hatch spacing just a little more dense, I probably would). Previously I could only hatch to a resolution of about 0.1, and now I am able to hatch to 0.0003 without the routine bombing. I've been trying different things to see if I can get the program to fail, so I think that changing this variable to zero really did the trick.

 

Thank you very much for the suggestion. I hope to someday be as knowledgable and many of the members on this site.

Ray

Link to comment
Share on other sites

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