solid group codes

Discussion in 'AutoCAD' started by antmjr, Jan 19, 2004.

  1. antmjr

    antmjr Guest

    Hi all. I'd like to understand the solid group codes; my documentation explains usual dxf codes like 10, 20, 220 etc, but says nothing about…+:' {rn {mg {jh |") (1 . ",+->687+r<*-): {rn nliqinlmhojgllhnn kll…etc. What is it? Where could I find an explanation?
     
    antmjr, Jan 19, 2004
    #1
  2. antmjr

    Rakesh Rao Guest

    The entity data of a 3dSOLID object is in encrypted ACIS format.

    If you use the EXPORT command in AutoCAD and export the object in ACIS
    SAT format, you will know what the ACIS format is. (i.e if you are not
    already aware of it).

    If you wish to retrieve this information in ACIS format from within
    AutoCAD, you have to get all the DXF code 1 from the entity list,
    decrypt it and build the ACIS file listing your self.

    A function you can use to decrypt the string is posted below:

    ;; !
    ***************************************************************************
    ;; ! MD_DecryptACIS
    ;; !
    ***************************************************************************
    ;; ! Function : Decrypt the ACIS format string info stored on a 3dsolid
    entity
    ;; ! Arguments: 'EncStr' - Encrypted string
    ;; ! Updated : October 26, 2001

    (defun MI_DecryptACIS( EncStr / DecStr tmpStr )
    (setq DecStr "")
    (while (> (strlen EncStr) 0)
    (setq
    tmpStr (substr EncStr 1 1)
    EncStr (substr EncStr 2)
    DecStr (strcat DecStr (if (= tmpStr " ")
    " "
    (chr (- 79 (- (ascii tmpStr) 80)))
    )
    )
    )
    )
    DecStr
    )


    I hope this helps. Let me know if you have more questions. I am not an
    expert in ACIS either maybe someone else might give you more info on
    this forum.

    - 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, Jan 19, 2004
    #2
  3. antmjr

    Daron Denton Guest

    here is something i picked up along the way. i don't know who the author is,
    or if it works. use at your own risk.

    daron

    =======================================================

    here is a beginning for you
    load this and enter (acis_poll) at the command line to give it a try

    you'll have to add support for curved surfaces, go to www.spatial.com to
    learn about the ".sat" file stucture

    if anyone succeeds with adding curves to this, send it back to us hmm?

    ;;; portion of acis library by matthew rothgery

    (defun acis_translate(string / item letter lst)
    (setq string(strcat string" ")item"")
    (while(>(strlen string)0)
    (setq letter(substr string 1 1)string(substr string 2))
    (if(=" "letter)
    (setq lst(append lst(list item))item"")
    (setq item(strcat item(chr(- 79(-(ascii letter)80)))))
    )
    )
    lst
    )

    (defun draw_aperture (pnt color / p1 p2 p3 p4)
    (setq pnt(trans pnt 0 1)
    p1 (mapcar'+(trans(list(- aperture)(- aperture)0)2 1)pnt)
    p2 (mapcar'+(trans(list(- aperture) aperture 0)2 1)pnt)
    p3 (mapcar'+(trans(list aperture aperture 0)2 1)pnt)
    p4 (mapcar'+(trans(list aperture (- aperture)0)2 1)pnt)
    )
    (grvecs(list color p1 p2 p2 p3 p3 p4 p4 p1))
    )

    (defun compute_center_point()'unsupported)

    (defun acis_poll(/ device point points pointn entity entityPrev viewsize
    viewctr aperture sat)
    (while(=(car(setq device(grread T 4 2)))5)
    (and pointn(draw_aperture pointn 0))
    (or(=(getvar"VIEWSIZE")viewsize)
    (=(getvar"VIEWCTR" )viewctr )
    (setq viewctr (getvar"VIEWCTR" )
    viewsize(getvar"VIEWSIZE")
    aperture(*(/
    viewsize(cadr(getvar"screensize")))(getvar"APERTURE"))
    )
    )
    (setq point(cadr device)entity(nentselp point))
    (if(and entity
    (setq entity(entget(car entity)))
    (=(cdr(assoc 0 entity))"3DSOLID")
    (or(equal entityPrev(setq entityPrev(cdr(assoc -1 entity))))
    (progn
    (setq points()sat())
    (foreach group entity(and(=(car group)1)(setq sat(append
    sat(list(acis_translate(cdr group)))))))
    (foreach line sat
    (cond
    ((wcmatch(car line)"point") ;;; this works for straight
    edges
    (setq points(cons(list 0(distof(nth 2 line))(distof(nth
    3 line))(distof(nth 4 line)))points))
    )
    ((wcmatch(car line)"coedge") ;;; start here for curved
    surface support
    ;(setq points(cons(compute_center_point)points))
    )
    )
    )
    )
    T
    )
    )
    (setq points(mapcar'(lambda(pnt)(cons(distance(cdr(reverse(trans point
    1 2)))(cdr(reverse(trans(cdr pnt)0 2))))(cdr pnt)))points)
    pointn(cdr(assoc(apply'min(mapcar'car points))points))
    )
    (setq pointn()entity())
    )
    (and pointn(draw_aperture pointn 2))
    )
    (and pointn(draw_aperture pointn 0))
    (if entity(list(cdr(assoc -1 entity))pointn))
    )




    Hi all. I'd like to understand the solid group codes; my documentation
    explains usual dxf codes like 10, 20, 220 etc, but says nothing about.+:'
    {rn {mg {jh |") (1 . ",+->687+r<*-): {rn nliqinlmhojgllhnn kll.etc. What is
    it? Where could I find an explanation?
     
    Daron Denton, Jan 19, 2004
    #3
  4. antmjr

    shanesparks Guest

    Hi Rakesh/All,

    Thanks for the excellent decryption method for ACIS.
    I have a lsp to display the DXF to dialogue, but the 3D
    codes were usesless until now. It works good to show
    what it all means. Now all I have to do is re-direct if
    it is 3D solid. Thanks to Daron and antmjr for their curiousity
    and drive also.

    Shane
     
    shanesparks, Jan 19, 2004
    #4
  5. antmjr

    Daron Denton Guest

    out of curiosity, what type of dialog and tile/control are you using? i
    posted one some time ago, but no one was interested.

    daron
     
    Daron Denton, Jan 19, 2004
    #5
  6. antmjr

    antmjr Guest

    thank you for the precious information! I bet these codes may be really useful. Does anybody know a tutorial for acis codes? I searched the web, but I don't find anything yet...
     
    antmjr, Jan 19, 2004
    #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.