Parallel continuous line hatch

Parallel continuous line hatch

abdalla.safwat
Observer Observer
2,541 Views
8 Replies
Message 1 of 9

Parallel continuous line hatch

abdalla.safwat
Observer
Observer

Anyone knows how to make that kind of hatch on Autocad, parallel lines that are connected from sides so it would start at a point go all the way through to the other side and move parallel and move back, it's basically all one long line. It's urgent, please give me insights or ideas other than offsetting a line and trimming and joining on the other side as I am working in a huge irregular shape that is not possible to trim all of it.

 

FB_IMG_1475825235873.jpgFB_IMG_1475825241469.jpg

0 Likes
2,542 Views
8 Replies
Replies (8)
Message 2 of 9

pendean
Community Legend
Community Legend
Your monochrome picture is not a hatch pattern: someone drew than line by line. You'll have to do the same in AutoCAD like you have in the second image (purple color).
0 Likes
Message 3 of 9

Kent1Cooper
Consultant
Consultant

@abdalla.safwat wrote:

Anyone knows how to make that kind of hatch on Autocad, parallel lines that are connected from sides so it would start at a point go all the way through to the other side and move parallel and move back, it's basically all one long line. ....


This will make a Polyline that does that [not "make that kind of hatch," since a Hatch pattern can't be like that] for the second image only, in which there are no islands cut out of the middle.  It takes advantage of the fact that when you Explode a Hatch pattern, all the resulting Lines end up as the "Previous" selection, and are in order across the Hatched area.

 

(defun C:PBFH ; = Polyline Back and Forth over Hatch
  (/ hsel lss n bf ldata)
  (if
    (and
      (setq hsel (entsel "\nSelect Hatch pattern of parallel lines to draw Polyline back and forth over: "))
      (member '(0 . "HATCH") (entget (car hsel)))
    ); and
    (progn ; then
      (command "_.explode" (car hsel))
      (setq
        lss (ssget "_P"); the Lines resulting from Exploding
        n (sslength lss); how many there are
        bf 10 ; = Back/Forth -- initial code for end of Line to start at
      ); setq
      (command "_.pline"); start one
      (repeat n
        (setq ldata (entget (ssname lss (setq n (1- n))))); next Line
        (command
          "_none" (cdr (assoc bf ldata)); start or end of Line 
          "_none" (cdr (assoc (setq bf (if (= bf 10) 11 10)) ldata)); other end
        ); command
      ); repeat
      (command ""); end Polyline
    ); progn
  ); if
); defun

 

HOWEVER, it will not do what you have in your first image, because the order of resulting Lines puts those that are collinear next to each other, so the Polyline jumps across the hole.  It's hard to imagine a way of getting it to do it as you want from a single Hatch pattern like that -- you would probably need to Hatch in separate pieces, or in newer versions in which Hatches can be Trimmed, draw some carefully positioned Lines between the zones, make in-place Copies of the Hatch, Trim to make them separate in each area, then run this on each piece.  Or, you may be able to use what it does with a single pattern, with some editing [but a lot less editing than manually drawing all the Polylines].

 

It does not, but could be made to, check that the Hatch pattern selected is of a pattern with only parallel continuous lines, nor do anything about the current Layer or Polyline width settings, nor [if you want to do either of these] retain the original Hatch pattern nor eliminate the Lines resulting from Exploding it.

Kent Cooper, AIA
0 Likes
Message 4 of 9

fkellogg
Advocate
Advocate

You might try turning your boundary line into a dashed line type, and then play around with the LTScale, to get it to approximate what you are after.

Nobody is going to notice, if you get it close.

0 Likes
Message 5 of 9

Kent1Cooper
Consultant
Consultant

@fkellogg wrote:

You might try turning your boundary line into a dashed line type, and then play around with the LTScale. ....


Not knowing what the intended use is, I couldn't say whether that would serve their purpose [though I doubt it], but if it might, then rather than use a linetype from the DASHED or HIDDEN families, use the EVENDASH linetype, in which the lengths of the dashes and gaps are equal.  That is the condition at least along straight edges of Hatched areas in their images.

Kent Cooper, AIA
0 Likes
Message 6 of 9

binuntachari
Contributor
Contributor

I TRIED. ITS WORKING GOOD. BUT SOME OBJECTS NOT WORKING COMPLETELY. SEE THE ATTACHED IMAGE. DO YOU HAVE ANY SOLUTION FOR THIS??

0 Likes
Message 7 of 9

Kent1Cooper
Consultant
Consultant

@binuntachari wrote:

.... SOME OBJECTS NOT WORKING COMPLETELY. .... DO YOU HAVE ANY SOLUTION FOR THIS??


No, sorry.  That's the same issue as with internal islands in my other description -- the drawing order of the Lines resulting from Exploding the Hatch pattern "carries across" from a Line on one side of the cutout to the collinear piece on the other side.  I can't imagine a way to get a routine to recognize that situation, and to find the right other Line that it should connect to [not adjacent to it in drawing order], and to get the parts on the other side of the cutout that are out of drawing-order sequence.  I expect you're stuck with having it do what it can, and fixing parts of it.

Kent Cooper, AIA
0 Likes
Message 8 of 9

binuntachari
Contributor
Contributor

can you change connection make fillet (curved) in the lisp file. plzz

0 Likes
Message 9 of 9

Kent1Cooper
Consultant
Consultant

I'm not sure who "you" is meant to be, but I'm trying to imagine what you mean by that.  Filleting parallel Lines results in fully half-circle Arcs, which I suppose might be what you want, if it's for something like in-floor heating pipes.  But they would, at least sometimes, extend outside the boundary of the original Hatch pattern.  Illustrate, please.

Kent Cooper, AIA
0 Likes