Open Polylines ......

Discussion in 'AutoCAD' started by DeviL, Dec 26, 2004.

  1. DeviL

    DeviL Guest

    Just wondering if it`s possible ........

    I have a dwg in which are over 5 000 polylines representing terrain
    contours.
    I want to export them to other app`s (maxx) and model a terrain, but it only
    works with CLOSED polylines.
    So if I select all entities in the dwg Object Properties Toolbar reports the
    polylines, either open or closed.
    The /open/closed tab is blank because both are selected.

    ((Open polylines are to be edited until I can close them.))

    Is there a way (lisp or something) ACAD (2000) could filter out either of
    them, open or closed one`s ?
    I could change the open or closed one to a freezed layer and see how many
    are to be edited ....
     
    DeviL, Dec 26, 2004
    #1
  2. Some lines LISP should do it. Create a selection set of all polylines /
    lwpolylines. The dxfcode 70 says if the polyline is open (0) or closed (1).
    If you need further help let me know.

    Juergen
     
    Jürgen Palme, Dec 27, 2004
    #2
  3. DeviL

    DeviL Guest

    How is it done ?
    I mean how can I - if all selected - remove either of the open or closed
    from selection; so only one type remains in selection ???
     
    DeviL, Dec 27, 2004
    #3
  4. Try this lisp:

    (defun c:scp () ;select_closed_polylines
    (setq ssc (ssget "X" '((-4 . "<AND")
    (-4 . "<OR")
    (0 . "POLYLINE")
    (0 . "LWPOLYLINE")
    (-4 . "OR>")
    (70 . 1)
    (-4 . "AND>")
    )
    )
    )
    )

    (defun c:sop () ; select_open_polylines
    (setq sso (ssget "X" '((-4 . "<AND")
    (-4 . "<OR")
    (0 . "POLYLINE")
    (0 . "LWPOLYLINE")
    (-4 . "OR>")
    (70 . 0)
    (-4 . "AND>")
    )
    )
    )
    )

    The command SCP stores all closed polylines in the variable SSC, the command
    SOP stores all open polylines in the variable SSO. In the command line you
    have access to these selection sets typing !SSO or !SSC (don't forget the
    leading "!").


    HTH
    Juergen
     
    Jürgen Palme, Dec 27, 2004
    #4
  5. DeviL

    DeviL Guest

    I`ll try it !

    Thx ...
     
    DeviL, Dec 27, 2004
    #5
  6. DeviL

    DeviL Guest

    So I`ve tried it but it didn`t work for me ....
    Or there is something about that lisp I don`t know how to use it.
    The "!" commands report "nil" ....
     
    DeviL, Dec 27, 2004
    #6
  7. Assuming you have some opened (lw)polylines, some closed (lw)polylines and
    any other objects in your drawing. Copy and paste the code I gave you in a
    file with the example name "select-poly.lsp" and store this file in the
    support path.
    Now load the lisp:
    Command: (load "select-poly.lsp") <ENTER>
    If you see now at the command line
    Command: C:SOP
    the file was loaded successfully.

    Now you can start the command SOP (if you want to select the open polylines)
    or SCP (if you want to select the closed polylines) or both commands:
    Command: sop <ENTER>
    <Selection set: a>

    Command:
    Command: scp <ENTER>
    <Selection set: c>

    If closed or opened polylines were found (all other objects are ignored),
    you will get an output <Selection set: nnn> in the command line (nnn is the
    internal number of the selection set). If no polylines are found, you wll
    get nil.

    Command: scp
    nil

    What you can do with this selectioin sets?
    Assuming you want to delete it:

    Command: Erase <ENTER>
    Select objects: !SSO (for all opened polylines)
    Select objects: <ENTER>
    Command.

    All opened polylines are removed. Doe the same with the closed polylines
    with any other edit command.

    HTH
    Juergen
     
    Jürgen Palme, Dec 27, 2004
    #7
  8. Jurgen,

    DeviL (and you) are very generously crossposting...
     
    Michael Bulatovich, Dec 27, 2004
    #8
  9. Sorry, I didn't have a look at the header(s).

    Excuse me
    Juergen
     
    Jürgen Palme, Dec 28, 2004
    #9
  10. It's easy to get caught ; )

     
    Michael Bulatovich, Dec 28, 2004
    #10
  11. DeviL

    DeviL Guest

    Now I`m not sure I can follow your conversation ... ????

    What about the header ?

    Are you Michael saying Juergen didn`t understand - or ?
     
    DeviL, Dec 28, 2004
    #11
  12. You sent your original post to a large number of newsgroups at once.
    ("cross-posting")
    When he replied, he did the same because he didn't notice.
     
    Michael Bulatovich, Dec 28, 2004
    #12
  13. DeviL

    DeviL Guest

    It was only to 3 NG`s!

    All right : today I`ve learned the meaning of word "cross-posting".

    Thx
     
    DeviL, Dec 28, 2004
    #13
  14. You're right. The names are so long that it looked much worse than that!
     
    Michael Bulatovich, Dec 28, 2004
    #14
  15. DeviL

    Huw Guest

    Unless I misunderstand, you don't need lisp. With all your plines selected, just start Quick Select, Apply to Current selection, Properties = Closed, Include in new selection set
     
    Huw, Jan 4, 2005
    #15
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.