Separate hatches via lisp

Is there a possibility to separate hatches via lisp, like in a-cad: (command "_-HATCHEDIT" hatch "_H")?

Comments

  • Anthony Apostolaros
    edited September 2022
    Yes, it would be possible with lisp. How exactly do you want to separate them? I don't know the Autocad -Hatchedit H option.

    If you just want to separate a non-contiguous hatch into its apparent parts, you can do that with the Create Separate Hatches option of Bricscad's Hatchedit command.
  • That's what I want to do, but I don't have that option (Bricscad v21). Is it only possible in v22?
  • I don't know v21 & 22, and I can't find it in the online help.
    I'm using v17, and I just assumed later versions would have it too.
    See attached mark-up of a screen-shot.
  • Anthony Apostolaros
    edited September 2022
    Maybe I misunderstood your original question. I thought you wanted to make a lisp function that would separate a hatch into parts. Now I think you just want to use the Create Separate Hatches option as part of a lisp function you're working on. That would require a letter option in the command-line version of the Hatchedit command, as you indicated in your original post.

    I don't know of any way to do that. But I've noticed that sometimes an option for a Bricscad command isn't included in the help files or in the list of options that appear on the command line. Maybe try different letters? H doesn't work for me.
  • Anthony Apostolaros
    edited September 2022
    But you could use Jimmy Bergmark's HatchB lisp function to create polylines around each part of the hatch, and then delete the hatch, and then select each polyline and hatch it and then delete the polyline, and assign the properties of the original hatch to all the new ones.
  • Maybe I wasn't very clear with my explanation. I want to separate an existing, non contiguous hatch (that I did not create) via lisp. I know how to do it manually over the dialog box, by using the hatchgenerateboundary command or something similar.
    But I want to automate the process in a lisp, either by using a command (like hatchedit "h" option in a-cad) or by using activex code and I wonder if it's even possible in Bricscad.
  • Anthony Apostolaros
    edited September 2022

    Maybe I wasn't very clear with my explanation. I want to separate an existing, non contiguous hatch (that I did not create) via lisp. I know how to do it manually over the dialog box, by using the hatchgenerateboundary command or something similar.
    But I want to automate the process in a lisp, either by using a command (like hatchedit "h" option in a-cad) or by using activex code and I wonder if it's even possible in Bricscad.

    My mistake. I misunderstood you, as I suggested in my last post. So you can create the lisp function you want. You can use the process described in that last post, except that you won't need Jimmy Bergmark's HatchB function. You can instead use the built-in command that you pointed out, which does the same thing.
    - Use the HatchGenerateBoundary command to create polylines around each part of the hatch.
    - Delete the hatch.
    - For each of the new polylines, create a hatch using the Select Entities option, and then delete the polyline.
    - Assign the properties of the original hatch to all the new hatches.
    - Maybe move all the new hatches to the back via Draworder?
  • Nice workaround, thank you DFLY! Also, thank you Anthony.
    Hopefully the bricscad guys will extend the hatchedit functionality in the future..