add vertex to hatch ?

add vertex to hatch ?

Anonymous
Not applicable
8,017 Views
8 Replies
Message 1 of 9

add vertex to hatch ?

Anonymous
Not applicable

Hello all,

 

Can someone have code share add vertex to hatch same this clip following:

 

https://www.youtube.com/watch?v=VX1VbybPeBI

 

 

Thanks.:)

 

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

Kent1Cooper
Consultant
Consultant

In new-enough versions of AutoCAD, you don't need any code.  See the brief mention of how to do it in AutoCAD starting at about 2:16 in that same video.  Select a Hatch pattern, and hover over its boundary grips at vertices and segment midpoints to see the options -- press the initial capital letter of an option [no Enter/space required] to use it.  You can Add a vertex from hovering over either a vertex grip [it will add one "down-stream" from that vertex] or a segment-midpoint grip.

Kent Cooper, AIA
0 Likes
Message 3 of 9

Anonymous
Not applicable

Thanks for repply.

 

I have a lot of hatch then use grips to edit hatch long time. If 2 or more hatch same position then edit grips each hatch and repeat edit long time. Maybe you have solution better. 

0 Likes
Message 4 of 9

Kent1Cooper
Consultant
Consultant

Make them associative Hatch patterns.  Then if two or more are defined in part along [for example] the same edge, if you Stretch whatever defines that edge, all Hatch patterns associated with it will follow that change, all at once.

Kent Cooper, AIA
0 Likes
Message 5 of 9

Anonymous
Not applicable
Kent, i knew assoc hatch.

I mean add vertex to hatch. Maybe recreat boundary and add vertex to pline then hatch again. Uhm. In the clip add pline by grreat. Can u post example code grread for add vertex pline ?

Thank you.
0 Likes
Message 6 of 9

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:
....
I mean add vertex to hatch. Maybe recreat boundary and add vertex to pline then hatch again. ... In the clip add pline by grreat. Can u post example code grread for add vertex pline ?
....

No need to recreate a boundary and re-Hatch it.  You can add [or move or remove] a vertex to a Hatch pattern's boundary using its perimeter grips, in just the same way you do to a Polyline, without any code, and without any boundary object(s) [Polyline or otherwise] -- just the Hatch pattern itself.  [Again, this has not always been possible, so you must have a new-enough version of AutoCAD.]  I didn't notice any mention of (grread) in the AutoCAD portion of that video clip -- am I missing something? -- but I don't think it's needed, anyway.

Kent Cooper, AIA
0 Likes
Message 7 of 9

Anonymous
Not applicable

Okey,

 

Pls see attached photo. edit hatch with grips multi point and 2 hatch.

 

maybe i need think another way. 

 

 

0 Likes
Message 8 of 9

ВeekeeCZ
Consultant
Consultant

I am fighting with a HATCH and PL-BOUDARYs creating - editing too. I can imagine like a dozen ways how to edit HATCH, none of those is without any issues.

 

I am recommending to stay with GRIP-EDITING for simpler edits. But there is like 5 ways how to use them... I suggest to TURN OFF hover menus and to control editing by CTRL key. See the SCREENCAST. Set it by the GRIPMULTIFUNCTIONAL system variable.

 

For more complicated edits you gonna need restore a boundary first, then edit a polyline. You can use some routines - probably the best one was written by _gile, found HERE.

 

And little code by me - to restore boudary of your double hatch - used in screencast above.

 

(defun c:hpass2one ( / ss en i)
  (if (and (setq ss (ssget '((0 . "HATCH"))))
	   (not (command "_.-HATCHEDIT" (ssname ss (1- (sslength ss))) "_B" "_P" "_Y"))
	   (setq en (entlast))
	   )
    (repeat (setq i (1- (sslength ss)))
      (command "_.-HATCHEDIT" (ssname ss (setq i (1- i))) "_AS" "_s" en "" "")))
  (princ)
)
0 Likes
Message 9 of 9

Anonymous
Not applicable

Okey.

 

Thanks BeekeeCZ.

0 Likes