Exploding a hatch

Discussion in 'AutoCAD' started by Laurie Comerford, Apr 8, 2005.

  1. Hi,

    If I use code to define and create a hatch, I can explode it by virtue of it
    being the last object in the drawing by using a Sendcommand

    "EXPLODE L "

    However I would far prefer to explode it directly.

    Can any one point me to how to explode a hatch with VBA?


    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Apr 8, 2005
    #1
  2. As far as I know, you can't explode a hatch with VBA.

    If you use SendCommand, it would be more robust
    to pass a LISP expression like

    (command "._EXPLODE" (entlast))

    (entlast) gives you the absoilute last entity regardless
    of whether its visible or not.
     
    Tony Tanzillo, Apr 8, 2005
    #2
  3. Hi Tony,

    That was the sad conclusion I'd reached.

    I'll take your advice about passing the lisp command.

    It's still going to be easier to create the hatch, explode it and use the
    resultant entities to find a regular series of locations inside a closed
    polyline, than to do the "is point inside" type exercise.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Apr 8, 2005
    #3
  4. Laurie,

    I posted some code a while back for someone
    that needed to find the rotation angle of a hatch that
    is attached to a rotated object. I iterated acad.Pat
    for my data. Don't know what you need to do but
    the idea might help.
    gl
    Paul
     
    Paul Richardson, Apr 8, 2005
    #4
  5. Hi Paul,

    The functionality is used in CADApps Landscape program.

    The user selects a closed polyline and the program draws tree blocks inside
    the polyline. To avoid all the computations of block location and checking
    that the location is inside the polyline, I hatch the area, explode the
    hatch and then get the locations of the resultant lines to insert the trees.
    A 'tree appearance' hatch is not viable for this for a variety of
    reasons.inclusive of "planting" the blocks on a Land Desktop (or in due
    course) a Civil 3D DTM and randomising the block appearance.

    I looked at your code for reading the "Acad.pat" file and admire the work
    you put into this. But for my case, the file data is irrelevant, as it is
    the locations of the items in the hatch that I need.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Apr 8, 2005
    #5
  6. I think if I had forgotten to add the rotation of
    the first entity in the hatch when printing the
    angle. Sorry it didn't help anyway.

    Good luck with your project.

    Paul
     
    Paul Richardson, Apr 8, 2005
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.