A custom hatch is in a dwg from a external user, can not use that hatch again.

ALANH
edited June 15 in LISP

As per the title have not had this problem till now. I have a dwg it has a custom hatch that has been used and can be seen and identified in the dwg. Properties tells me it is Predefined/patternname.

If I try to hatch another object it errors with can not use that pattern. Yes I understand if I was to make the missing pattern then I could use it. But the issue here is that I am looking at some one else's dwg. I am surprised that the pattern is not available, given I can see and touch it. It is in response to another post about a lisp program to draw hatched rectangs.

Anybody had this issue or have any ideas how to use an existing custom hatch. When you do not have the Pat file.

Comments

  • It could be that the problem hatch is a proxy object. BricsCAD has enough information to show the graphic object (does it print OK?), but not reuse it.

  • The hatch is in a block, so can insert and works fine. have exploded. But if I try to just "HATCH" an object I can not use that hatch pattern. In the hatch dialog it has option "Inherent Properties" but this errors on the custom pattern. It just looks like only way is actually add the missing pat file. I may put forward a support request about this.

  • Not sure, how the block with a custom hatch without proper pat file can be inserted and exploded, but it's not possible to create or inherit properties of the hatch with a missing pattern definition.

  • Thanks @Lyubov Osina for reply, the block exists in a dwg I went to use the hatch for a different object, but I can not use that hatch pattern, I would have thought that if pattern exists in dwg then can use again. The original problem came about from a forum post about using lisp to make an object made of multiple entities including the hatch pattern. The lisp was tested using known default patterns and works. If using a dwt then maybe the hatch should be available.

  • Unfortunately, hatches depend on external source - pattern definitions, which can be included to the default *.pat files or custom *.pat files.

  • Alan, are you able to edit the hatch entity in question, using the Trim and/or Scale commands? If so, are you able to make a copy of the hatch entity and then edit that new hatch entity to fit the space you want to fill with that hatch pattern?

    As far as being able to extrapolate a hatch definition from a hatched entity in a file from someone else: I've never been able to do that.

  • Anthony yes that worked, but as the question is related to a forum post, a solution has been provided using lisp to make new entities including hatch's, it fails if you use a hatch pattern that is not available to you ie a custom hatch. Testing was done using default hatch patterns nad works fine. It just looks like one of those little "Gotcha" problems.

    Can consider this post closed.

  • The workaround I use is to copy the hatch and then associate it with a new boundary.

    The following script speeds that up a bit.

    (defun C:HatchAssociate ( / hatch obj)

    (if
    (and
    (setq hatch (car (entsel "\nSelect hatch: ")))
    (not (redraw hatch 3))
    (= "HATCH" (cdr (assoc 0 (entget hatch))))
    )
    (if
    (setq obj (car (entsel "\nSelect boundary <select Point>: ")))
    (command "_.-HATCHEDIT" hatch "_AS" "
    S" obj)
    (command "
    .-HATCHEDIT" hatch "_AS")
    )
    (progn
    (if hatch (redraw hatch 4))
    (princ "No hatch selected.")
    )
    )
    (princ)
    )

    BTW, did posting code not work in the forum before? This is pathetic.

  • Good idea but that just removed the hatch from one object and placed it onto a new object. You would have to copy the hatch and then use (entlast) to get the hatch that is to be relocated.

    The original question was around making a new block with a hatch. The block being made via a lisp and contains multiple objects including two hatches. So if the first block is to be made the method would fail as there maybe no hatch to select, the lisp had the hatch pattern hard coded. Its do with using custom hatches and the way they are saved in a dwg.