HATCH boundary objects - reverse engineering

Discussion in 'AutoCAD' started by Rakesh Rao, Aug 22, 2003.

  1. Rakesh Rao

    Rakesh Rao Guest

    Hello,

    I need programming assistance on two things (LISP preferred, VB also ok):

    1. To re-create all the constituent boundary paths by reading a HATCH
    object. The HATCH object may be non-associative and can contain islands
    etc. Boundaries may contain polylines with arcs or splines. I have
    managed the simple straight line polylines but the arcs are stumping me.

    2. To identify the hatched and non-hatched polygons from a list of
    polygons in an island hatch pattern. I tried to go by the DXF code 92
    but am still confused after a few tests.

    Any pointers welcome.

    Regards
    Rakesh

    --

    AutoCAD customization for Engineering/Mapping/GIS
    Get GeoTools @ http://www.4d-technologies.com/geotools
    Build MyGeoTools @ http://www.4d-technologies.com/geotools/my_geotools.htm
    FREE downloads : http://www.4d-technologies.com/techcenter
    </PRE>
     
    Rakesh Rao, Aug 22, 2003
    #1
  2. Rakesh Rao

    Dan Allen Guest

    Lisp to recreate hatch boundaries by Jimmy Bergmark attached.

    Dan
     
    Dan Allen, Aug 22, 2003
    #2
  3. Rakesh Rao

    C Witt Guest

    I thought i'd give it a try, but when I try to load it.. I get this..

    ;error: syntax error

    thoughts?

    (vanil. 2K4)
     
    C Witt, Aug 22, 2003
    #3
  4. Rakesh Rao

    Paul Turvill Guest

    That error indicates any of dozens of possible errors in the .lsp file
    you're attempting to load. Looking at the code posted, it's likely that word
    wrap has broken one or more of the lines of code, so as to make them
    unintelligible to the LISP interpreter. You may have some luck with either
    the LISP Analyzer in Migration Assistance, or with the VLIDE editor and its
    built-in analysis and debugging functions.

    Or, just manually search through your file, making sure that there aren't
    any misplaced line breaks.
    ___
     
    Paul Turvill, Aug 22, 2003
    #4
  5. Rakesh Rao

    C Witt Guest

    ok, dumb question.. where is Migration Assistance?
     
    C Witt, Aug 22, 2003
    #5
  6. Rakesh Rao

    Paul Turvill Guest

    It came on the CD with AutoCAD2000 and (I believe) 2000i. You may have do
    download it separately from the Autodesk Web site for later versions.
    ___
     
    Paul Turvill, Aug 22, 2003
    #6
  7. Rakesh Rao

    Paul Turvill Guest

    On a quick look, I found one obvious error:
    (if (and A2k (=3D (strcase (cdr (assoc 410 ed1))) "MODEL"))
    should be
    (if (and A2k (= 3D (strcase (cdr (assoc 410 ed1))) "MODEL"))
    -- a space is required after the "=" function. There may be others like
    this.

    There are other problems as well; there are a number of localized variables
    that don't appear in the code, for example, and other symbols that should be
    localized that aren't. Those "=" signs in the declaration shouldn't be
    there; it looks like somewhere along the line, some app inserted them where
    spaces (or more likely) linebreaks originally appeared. The symbol 'bptf'
    appears in the code, but neither 'part' nor 'bptf=part' do '*modelspace*'
    appears, but '*model=space*' does not; 'en2' is used, but 'en=2' is not;
    etc.

    You need to either find an original copy of the code or do considerably more
    cleanup.
    ___
     
    Paul Turvill, Aug 22, 2003
    #7
  8. I don't think the 3D is supposed to be there at all. Almost looks like a
    GroupWise to HTML to Text email conversion problem. The code posted by Dan
    didn't have that.


    --
    R. Robert Bell, MCSE
    www.AcadX.com


    | On a quick look, I found one obvious error:
    | (if (and A2k (=3D (strcase (cdr (assoc 410 ed1))) "MODEL"))
    | should be
    | (if (and A2k (= 3D (strcase (cdr (assoc 410 ed1))) "MODEL"))
    | -- a space is required after the "=" function. There may be others like
    | this.
    |
    | There are other problems as well; there are a number of localized
    variables
    | that don't appear in the code, for example, and other symbols that should
    be
    | localized that aren't. Those "=" signs in the declaration shouldn't be
    | there; it looks like somewhere along the line, some app inserted them
    where
    | spaces (or more likely) linebreaks originally appeared. The symbol 'bptf'
    | appears in the code, but neither 'part' nor 'bptf=part' do '*modelspace*'
    | appears, but '*model=space*' does not; 'en2' is used, but 'en=2' is not;
    | etc.
    |
    | You need to either find an original copy of the code or do considerably
    more
    | cleanup.
    | ___
    |
    | > ok.. this is what i've got now..
    | >
    | > But it is still returning errors. and sometimes won't work at all.
    | >
    | > can you do anything more with it?
    |
    |
     
    R. Robert Bell, Aug 22, 2003
    #8
  9. Rakesh Rao

    C Witt Guest

    Dan's post did have the 3D, you just have to look further down. it's in
    there multiple times.
     
    C Witt, Aug 22, 2003
    #9
  10. Rakesh Rao

    Paul Turvill Guest

    Voila! Mr. Bell hit it on the nose. Remove all occurrences of '3D' as a
    standalone symbol, and the routine works as advertised.
    ___
     
    Paul Turvill, Aug 22, 2003
    #10
  11. Rakesh Rao

    C Witt Guest

    I don't supose you know how to add to this so that it works on elipticle
    curves?
     
    C Witt, Aug 22, 2003
    #11
  12. Rakesh Rao

    C Witt Guest

    thank you, works now.
     
    C Witt, Aug 22, 2003
    #12
  13. Rakesh Rao

    Paul Turvill Guest

    Not quickly. The original author may have written most of the code before
    the advent of a "true" ellipse. It does work, though, with ellipses that are
    approximated by polylines (i.e., generated with PELLIPSE = 1).
    ____
     
    Paul Turvill, Aug 22, 2003
    #13
  14. Rakesh Rao

    Paul Turvill Guest

    Nope. Sorry.
    ___
     
    Paul Turvill, Aug 23, 2003
    #14
  15. Rakesh Rao

    Rakesh Rao Guest

    Hello,

    I thank everyone - Jimmy Bergmark, Dan Allen and all other who
    contributed in this thread with their inputs. With some editing as
    indicated by the posts, I was able to get the routine to work.

    Regards
    Rakesh


    --

    AutoCAD customization for Engineering/Mapping/GIS
    Get GeoTools @ http://www.4d-technologies.com/geotools
    Build MyGeoTools @ http://www.4d-technologies.com/geotools/my_geotools.htm
    FREE downloads : http://www.4d-technologies.com/techcenter
    </PRE>
     
    Rakesh Rao, Aug 23, 2003
    #15
  16. Rakesh Rao

    Jimmy B Guest

    Jimmy B, Aug 25, 2003
    #16
  17. Rakesh Rao

    Jimmy B Guest

    Jimmy B, Aug 25, 2003
    #17
  18. Rakesh Rao

    Jimmy B Guest

    Jimmy B, Aug 25, 2003
    #18
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.