[LISP] Extrude problem

Discussion in 'AutoCAD' started by kam--mik, Nov 2, 2004.

  1. kam--mik

    kam--mik Guest

    I am having a very odd experience:

    Basically I have a list of 3d polyline, and I use the extrude command to
    create 3D solids for each object inside this list.

    1st time running: Only first 10-20 objects can be extruded. (For others,
    there's an error message of: Unable to extrude the selected object.)
    Then I delete all and run this program again
    2nd time running: All objects CAN be extruded.

    So what's wrong with it? The following is the core part:


    (make-3dpolyline ptlist) ;Create a 3d polyline from list
    (setq ss1 (ssget "L")) ;Get the newly made 3d polyline
    (setq tmpH (car (cddddr item))) ;Get the Height from somewhere
    (command "Extrude" ss1 "" tmpH "") ;Execute Extrude
    (setq ss1 nil)
     
    kam--mik, Nov 2, 2004
    #1
  2. kam--mik

    kam--mik Guest

    hi all, I found a little bit more hints!

    The fact is that: for those objects outside the viewing area, they get
    problem!!!
    So when I zoom out to a reasonable extent, and then run the program, it
    works!!!!

    Can anyone tell me why is that? And what is the common way to handle this
    problem? (Since when the data getting larger and larger, the program should
    handle what would be the viewing area)

    My guess is that the (ssget) cannot get an object outside the viewing area,
    anyway I'm not sure.


    Thanks all
     
    kam--mik, Nov 2, 2004
    #2
  3. kam--mik

    Ken Krupa Guest

    The problem is not ssget, but (ssget "L"). "Last" behaves this way. Try
    using (entlast) instead ssget:
    (command "Extrude" (entlast) "" tmpH "")
     
    Ken Krupa, Nov 2, 2004
    #3
  4. kam--mik

    kam--mik Guest

    (entlast) works well, many thanks!


     
    kam--mik, Nov 3, 2004
    #4
  5. kam--mik

    Adesu Guest

    Hi Ken,thanks a lot for your info about "(command "Extrude" (entlast) ""
    tmpH "")"
     
    Adesu, Mar 22, 2005
    #5
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.