Lisp Solid to Surface by entget

Greetings,
I'm recently working on an AutoLisp script, that is  supposed to read information from a drawing  to a file.

The way I do it is:
I get a list of all entity names within the model space.
Then I first extract the "INSERT"s information.
When I extract INSERT information I make a list of all sub-entities contained within the INSERT.
Then I get all the entities information from that list. (getting the INSERT information is recursive, so i can find inserts within inserts all the way down)
After I extracted the INSERTs information I extract the Information of all other entities within the model space.

My problem now is, that 3D-Solids are basicly unreadable for me. I do get all the  SAT information from the DXF groupcodes, yet SAT information is useless for me.

Jason Bourhill provided a Lisp script on this Forum, in a thread a collegue of mine opened, to make wireframe surfaces from userselected 3DSOLIDs.
The link to the post: https://forum.bricsys.com/discussion/19155#19206

Does anyone know a way to replace the userselection  to exchange the user selection in a way I can pass on the entitiy name (dxf groupcode -1)  convert the entitiy I hand over via its entity name?

Comments

  • Do you mean this?
    [code](setq ename (car (entsel)))
    (command "_erase" ename "")[/code]
  • Hi Steven,

    instead of trying to convert solids to wireframe surfaces and script this conversion to get
    to the solid-infos you need (if at any ?), i would suggest to look over at this thread

    http://www.theswamp.org/index.php?topic=39278.0;all

    and use the .NET Lisp utility (a LISP function gc-brep) to get to the required solid data.
    Just download  BrepLispFunction.zip
    and try it...it should work with Bricscad V12...

    Regards


  • Do you mean this?
    (setq ename (car (entsel)))
    (command "_erase" ename "")

    I thought f it more like this (assuming  the var "step" contains the complete dxf Group code Information)

    [code]
    (setq en (cdr(assoc -1 step)))
    (setvar "VlipBoardFormat" 19)
    (command "._COPYBASE" '(0.0 0.0 0.0)  en "")
    (command "._PASTECLIP '(0.0 0.0 0.0))
    [/code]

    Would it work that way? Would the pasted entity be a congruent copy of the original 3DSOLID, just well built out of other entities than 3DSOLIDs, REGIONs, and other SAT data? I'm asking before I start try and error to see if I understood it correct.

  • @ Steven:
    The intention of my previous post was to give a simple example of how you can use an ename instead of a selection set. I haven't checked Jason's code or tested your code, but your suggestion looks OK.

    When I extract INSERT information I make a list of all sub-entities contained within the INSERT.
    Then I get all the entities information from that list. (getting the INSERT information is recursive, so i can find inserts within inserts all the way down)

    Are you translating the coordinates of nested entities to the coordinate system of their parent entity while you are doing this? This may be required.

  • I'm translating the coordinates to the parent entity. This way i don't have to read every sublist over and over, when an INSERT was copied and pasted in an other place.
This discussion has been closed.