Getting info on hatch entities

Discussion in 'AutoCAD' started by Rabbit, Feb 24, 2005.

  1. Rabbit

    Rabbit Guest

    I have a hatch pattern where the lines are set up in a 12"x12" grid. I want
    to place a block in the center of one of the "holes". how would I go about
    getting the info from the individual lines so that I could find the
    intersections? I have a neat little routine that I got from this newsgroup
    which will let me get the midpoint between two points.


    Here's a crude idea of what I'm trying to accomplish:

    I want to insert the block at the midpoint of p1 and p2.
    The vertical and horizontal lines represent lines that are within the hatch
    pattern.


    | p1 |<-----line that is part of the hatch
    pattern
    ----X---------------------
    | |
    | |
    | X<-- insert point of block
    | |
    | |
    ----------------------X-----
    | | p2

    Here's my routine for getting the midpoint:

    (defun MidPnt (p1 p2)
    (mapcar '(lambda (a b) (/ (+ a b) 2.0)) p1 p2)
    )
     
    Rabbit, Feb 24, 2005
    #1
  2. If I understand your description correctly, the "individual lines" really
    aren't, at least from AutoCAD's point of view -- they're part of a hatch
    entity. So you can't select the lines, because AutoCAD will "find" the same
    entity for each of them. But INTersection Osnap works on intersections
    within hatch patterns, so that's where I'd go to get the information on the
    points you want to find the midpoint between.
     
    Kent Cooper, AIA, Feb 24, 2005
    #2
  3. Rabbit

    Rabbit Guest

    Thanks Kent. I guess I'll have to totally reevaluate my direction on how I
    want my routine to work.

    --
    Rabbit
     
    Rabbit, Feb 25, 2005
    #3
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.