Page 1 of 1

having problems applying hatch to an area

Posted: Wed Aug 09, 2023 7:50 pm
by Mike Gera
I am trying to apply a hatch to the region in the .SLDDRW shown below but am getting the error shown.

What am I doing wrong?

Thanks.
2023-08-09 19_48_15-SOLIDWORKS Premium 2022 SP5.0 - [hatch_test - Sheet1 _].png

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 6:06 am
by Shaun
I have not downloaded the files as I still use SW2019.

I think it may not like the longer vertical line extending beyond the horizontal lines for boundary selection.

Have you tried selecting region as below and clicking inside the region?
image.png

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 7:53 am
by AlexLachance
Don't select the lines. Click inside the square rather.
image.png

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 8:19 am
by Mike Gera
AlexLachance wrote: Thu Aug 10, 2023 7:53 am Don't select the lines. Click inside the square rather.

image.png
When I do that, nothing happens. Set to "Region".

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 8:26 am
by AlexLachance
Mike Gera wrote: Thu Aug 10, 2023 8:19 am When I do that, nothing happens. Set to "Region".
That's odd, it works for me in SolidWorks 2019.

This is a GIF. Click on it to see it
hatch.gif

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 8:28 am
by AlexLachance
From your screenshot in the first post, it seems there is a viewport where your jointed lines are and the long line may be outside of the viewport. Select all, cut it, double click on view port, paste it and retry, see if it works.

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 9:06 am
by DanPihlaja
The line on the left is part of the view (hence the border) The rest of the lines are NOT in that view.

Activate the view, then redraw your lines and it should work.

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 9:19 am
by Mike Gera
I redrew the sketch, making sure that all 4 lines are inside the view. Files attached. I still can't get "region" (or "boundary) to work.

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 9:20 am
by Mike Gera
AlexLachance wrote: Thu Aug 10, 2023 8:26 am That's odd, it works for me in SolidWorks 2019.

This is a GIF. Click on it to see it
hatch.gif
Alex, what program did you use to create that .gif?

Thanks.

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 9:28 am
by AlexLachance
Mike Gera wrote: Thu Aug 10, 2023 9:20 am Alex, what program did you use to create that .gif?

Thanks.
ScreenToGIF

https://www.screentogif.com/

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 9:43 am
by DanPihlaja
DanPihlaja wrote: Thu Aug 10, 2023 9:06 am The line on the left is part of the view (hence the border) The rest of the lines are NOT in that view.

Activate the view, then redraw your lines and it should work.
OK, I was wrong. I see now that this is a sketch from the part level. Looking at it now.

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 9:58 am
by DanPihlaja
Mike Gera wrote: Thu Aug 10, 2023 9:19 am I redrew the sketch, making sure that all 4 lines are inside the view. Files attached. I still can't get "region" (or "boundary) to work.
OK, i see what you did now.

You used sketch entities at the part level and then used "Convert entities" at the drawing level to create those lines.

This is weird.

I can draw a rectangle (at the drawing level), and hatch it just fine. But your lines, I can't do anything with.

If I delete and redrawing your lines (using "convert entities" to to pull from your part sketch, then trim the right hand line back to be limited by your to horizontal lines, then I can get it to work. But I cannot get it to work with your original lines.
image.png

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 10:42 am
by Mike Gera
DanPihlaja wrote: Thu Aug 10, 2023 9:58 am OK, i see what you did now.

You used sketch entities at the part level and then used "Convert entities" at the drawing level to create those lines.

This is weird.

I can draw a rectangle (at the drawing level), and hatch it just fine. But your lines, I can't do anything with.

If I delete and redrawing your lines (using "convert entities" to to pull from your part sketch, then trim the right hand line back to be limited by your to horizontal lines, then I can get it to work. But I cannot get it to work with your original lines.

image.png
Ah, this seems like a bug (or an oversight).

How do I resize the viewport box?

Thanks.

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 12:50 pm
by Mike Gera
This is my latest attempt:
hatch.gif

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 1:03 pm
by DanPihlaja
Mike Gera wrote: Thu Aug 10, 2023 10:42 am Ah, this seems like a bug (or an oversight).

How do I resize the viewport box?

Thanks.
I hit CTRL Q to run a rebuild and it auto resized.

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 1:04 pm
by DanPihlaja
Mike Gera wrote: Thu Aug 10, 2023 12:50 pm This is my latest attempt:

hatch.gif
OK, as far as I know, hatch needs to use the entire line. So your line on the right needs to be ONLY the length between the 2 horizontal lines.

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 1:07 pm
by jcapriotti
Mike Gera wrote: Thu Aug 10, 2023 12:50 pm This is my latest attempt:

hatch.gif
Double click the view to activate it, then try the region option,

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 1:11 pm
by Mike Gera
DanPihlaja wrote: Thu Aug 10, 2023 1:03 pm I hit CTRL Q to run a rebuild and it auto resized.
Mine does not for some reason.

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 1:12 pm
by Mike Gera
jcapriotti wrote: Thu Aug 10, 2023 1:07 pm Double click the view to activate it, then try the region option,
Still does not work.

But, I did just learn that views can be activated via double-clicking!

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 1:35 pm
by AlexLachance
Mike Gera wrote: Thu Aug 10, 2023 1:12 pm Still does not work.

But, I did just learn that views can be activated via double-clicking!
Careful though, you can draw/add annotations thinking you're attaching them to another view and they actually get added to the view you double clicked on.

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 1:42 pm
by Mike Gera
AlexLachance wrote: Thu Aug 10, 2023 1:35 pm Careful though, you can draw/add annotations thinking you're attaching them to another view and they actually get added to the view you double clicked on.
Thanks for the heads-up.

I've done that more than once (as in hundreds of times), even before knowing how to lock the view selection.

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 1:50 pm
by jcapriotti
Odd behavior, if I convert entities like you did in that file you attached, it doesn't hatch by region. Deleting all of the "on edge" relations allows it to work.

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 1:58 pm
by Mike Gera
jcapriotti wrote: Thu Aug 10, 2023 1:50 pm Odd behavior, if I convert entities like you did in that file you attached, it doesn't hatch by region. Deleting all of the "on edge" relations allows it to work.
Yes, I'm now able to get it to work by deleting the on-edge relations. This must be a bug. Does someone want to report it?

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 2:04 pm
by JSculley
Definitely some sort of quirk. If you drag the end points of the two horizontal lines to move them off the vertical line:
image.png
You can then hatch the region:
image.png
and drag the endpoints back:
image.png
Or, hatch it in the model and avoid the convert entities mess altogether:

image.png
image.png

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 2:16 pm
by jcapriotti
Makes me think there is some tolerance issue with convert entities....like the ends aren't touching to create a closed region. Removing the "on edge" maybe recalculates the position more accurately....I don't know. Who knows what programming tricks are going on in the background to get around other issues we aren't aware of. Our own internal programs have some code that would leave people scratching their head at first glance.....until we explain why.

Re: having problems applying hatch to an area

Posted: Thu Aug 10, 2023 3:21 pm
by Glenn Schroeder
Adding hatching in Drawings has been flaky for the entire 14 years I've been using SW.

Re: having problems applying hatch to an area

Posted: Fri Aug 11, 2023 7:20 am
by Mike Gera
I discovered that if I break up "complex" regions, hatch works. Sort of. It still requires multiple clicks and some luck.

See attached example.

Try deleting the hatch and the break lines, then applying hatch to the entire region.

Note that hatch and break lines are on their own layers.