Jump to content

batch hatch


Recommended Posts

I want hatch (different pattern) many areas that made by lines

I have coordinate of internal point, pattern name, hatch color, background color in excel sheet

Can anybody tell me how I do that at ones?

Link to comment
Share on other sites

Are the areas closed? You can run a macro created in Excel to do what you need for hundreds of hatches but if there are any non 'closed' areas it will break the chain of commands.

If you are sure all areas are closed then post a sample of the excel data, it will probably need sorting into a different order, it will be easier to explain with a sample to work from.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Matching your sample put this in cell G2 =CONCATENATE("-hatch Properties ",C2," ",D2," ",E2," ",A2,",",B2," ") then copy down for all hatches, then select the cells in column G copy then paste to Autocad command line. hatches should appear.

  • Like 1
Link to comment
Share on other sites

This should work, select the 'yellow' cells Ctrl+c then in AutoCAD LT make sure the command line is active, the cursor should be blinking in the command line, so you might need to click on the command line a couple of times, then Ctrl+v (if the command line isn't active then AutoCAD will use pasteclip).

 

Hatch.xlsx

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

I wrote 320 line in excel sheet to hatch 320 areas
The problem comes in when I try to copy all line and paste in command line

"Valid hatch boundary not found.
Point is directly on an object."

but when I copy just 5-10 line and zoom to areas it works

all areas are closed and internal point is correct.

Is there a way to do that at ones?

HATCH.dwg HATCH.xlsx

Link to comment
Share on other sites

Running a script brings with it a few problems all of it's own. For example if the coordinates you use are close to snap points then Autocad will still snap to them, I don't think that is the problem here though. In any case it is wise to turn off osnaps before running a script unless your script actually uses osnaps.

The hatch command can be fussy with internal pick points if it can't 'see' the whole area physically on the screen, so you would need to zoom to each hatch area before using the hatch command. But another problem here are the coordinates you are using the pick points are just too close to the boundaries only 0.1 units away and even in a script AutoCAD thinks it is you entering commands and clicking with the mouse, it looks like AutoCAD thinks you are picking the boundaries because your coordinates are so close to the edges.

We would need to see your command history to say for certain exactly what the problem is, but if you run the script and look through the command history yourself you probably will see 

Analyzing the selected data...
Point is directly on an object.

This shows that your coordinates are too close to the boundary lines, or you might also see

Analyzing the selected data...
Valid hatch boundary not found.

Teling you AutoCAD can't 'see' the boundary as it isn't on screen.

You could start each line of the script with the zoom command and use the 'centre' option giving it the same coordinates as the hatch pattern and then a zoom level of maybe 100 (thats going to be trial and error) but most important is first make the coordinates closer to the centre of the hatch areas, or at the very least further from the edges.

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