Open Polylines ......
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Open Polylines ......

 
Post new topic   Reply to topic    CADForums.net Forum Index -> AutoCAD
Author Message
DeviL
Guest





Posted: Mon Dec 27, 2004 12:38 am    Post subject: Open Polylines ...... Reply with quote

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 ....

Back to top
Jürgen Palme
Guest





Posted: Mon Dec 27, 2004 1:02 pm    Post subject: Re: Open Polylines ...... Reply with quote

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


"DeviL" <arhitekt_hr@yahoo.com> schrieb im Newsbeitrag
news:cqnnc3$mgg$1@bagan.srce.hr...
Quote:
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 ....

Back to top
DeviL
Guest





Posted: Mon Dec 27, 2004 2:24 pm    Post subject: Re: Open Polylines ...... Reply with quote

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 ???

Back to top
Jürgen Palme
Guest





Posted: Mon Dec 27, 2004 4:13 pm    Post subject: Re: Open Polylines ...... Reply with quote

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
Back to top
DeviL
Guest





Posted: Mon Dec 27, 2004 4:16 pm    Post subject: Re: Open Polylines ...... Reply with quote

I`ll try it !

Thx ...
Back to top
DeviL
Guest





Posted: Mon Dec 27, 2004 4:57 pm    Post subject: Re: Open Polylines ...... Reply with quote

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" ....
Back to top
Jürgen Palme
Guest





Posted: Mon Dec 27, 2004 5:31 pm    Post subject: Re: Open Polylines ...... Reply with quote

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



"DeviL" <arhitekt_hr@yahoo.com> schrieb im Newsbeitrag
news:cqotav$e7j$1@bagan.srce.hr...
Quote:
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" ....

Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> AutoCAD All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB