How to explode a hatch into polylines?

How to explode a hatch into polylines?

edushka228
Enthusiast Enthusiast
2,076 Views
9 Replies
Message 1 of 10

How to explode a hatch into polylines?

edushka228
Enthusiast
Enthusiast

I need to write a lisp that will apply the EXPLODE command functionality to hatches, so that the elements of the hatch are turned into polyline objects.

But this must be done so that a closed loop object is a single polyline of more than two points.

 

edushka228_1-1713266795849.png

 

0 Likes
Accepted solutions (1)
2,077 Views
9 Replies
Replies (9)
Message 2 of 10

marko_ribar
Advisor
Advisor

You have an answer in this previous topic of yours...

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/is-it-possible-to-write-a-lisp-that-... 

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 3 of 10

edushka228
Enthusiast
Enthusiast

Either I can't find a code that performs such functionality, or you don't understand the essence of the problem. I need a code that breaks hatchings not into separate polylines, but into closed polylines of several points.

0 Likes
Message 4 of 10

marko_ribar
Advisor
Advisor

Yes, your request is described in topic I gave you link... It is not exploding hatch and make bunch of 2 points polylines, but bunch of closed polylines, just there is one step in between - from exploded lines, you'll have to build regions, explode them and you'll get joined polylines after joining each region that was created... And this is exactly procedure that was posted in my codes in link I already showed...

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 5 of 10

edushka228
Enthusiast
Enthusiast

Despite this, I get separate polylines. That is, one polyline is no larger than two points

0 Likes
Message 6 of 10

Sea-Haven
Mentor
Mentor

I used a triangle hatch exploded hatch found the objects were plines so exploded all inside the rectang. Then just did

: JOIN
Select source entity or multiple entities to join at once: 
Opposite Corner: 
Select entities to join: 
48 entities joined into 18 polylines, 2 entities discarded from the operation

No code a couple of seconds.

 

May need a dwg to check what your hatch is.

 

0 Likes
Message 7 of 10

marko_ribar
Advisor
Advisor

I have a question : What software are you using?

Maybe command "REGION" is not working what should...

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 8 of 10

edushka228
Enthusiast
Enthusiast

For some reason the join command doesn't show me the desired result.

The file - 

0 Likes
Message 9 of 10

Kent1Cooper
Consultant
Consultant
Accepted solution

It's probably the result of the pieces of the Hatch not meeting precisely enough -- just an effect of patterns with odd-ball angles, because of decimal-place limitations on precision.  Use EXPLODE / {the Hatch, and Enter to complete selection) / PEDIT / Multiple / Previous {and Enter to complete selection} / Join / give it a small but non-zero fuzz distance.

 

[If you build that into an AutoLisp (command) function, you don't need the Enter to complete selection in the EXPLODE command.]

 

It's possible it could also be "fixed" by increasing the precision of the Hatch pattern definition.

Kent Cooper, AIA