ksxdqn Posted December 13, 2013 Share Posted December 13, 2013 I have many lines and polylines (In drawing). I want to convert them to closed polylines. In past, i used command "Bpoly" - click into space in object.It get me many time. Now i want convert them to closed-polylines ( Select all them ---> Enter----> To closed-polylines) Help me to write cad lisp include only step! Thanks! Exp Closed Polylines.dwg Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted December 13, 2013 Share Posted December 13, 2013 I can't think of anything built in at the moment. Someone correct me if I'm missing something. In the meantime, you might take a look at some 3rd party tools out there that contain this functionality, such as: http://www.4d-technologies.com/geotools/ http://www.dotsoft.com/toolpac.htm Quote Link to comment Share on other sites More sharing options...
ksxdqn Posted December 13, 2013 Author Share Posted December 13, 2013 What's problem with my request? It's difficult to write autolisp??? Quote Link to comment Share on other sites More sharing options...
Dana W Posted December 13, 2013 Share Posted December 13, 2013 What's problem with my request? It's difficult to write autolisp???Take a look on Lee Mac's website. I am sure he probably has a FREE Lisp that will join groups of polylines together. i would also take note that this is a forum frequented by busy professionals who will not respond faster to demands than they will to polite requests that include complete information about the existing problem. Quote Link to comment Share on other sites More sharing options...
eldon Posted December 13, 2013 Share Posted December 13, 2013 I think that Bpoly is the best way to go. How much time are you wanting to save and how much is it worth to you? Have you got a lazy clicking finger Quote Link to comment Share on other sites More sharing options...
rkent Posted December 13, 2013 Share Posted December 13, 2013 ;;---------------------=={ Polyline Join }==------------------;;;; ;; ;; Attempts to join all Lines, Arcs and LWPolylines in a ;; ;; selection. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - http://www.lee-mac.com ;; ;;-- ----------------------------------------------------------;; Go to lee-mac.com and download the polyjoin.lsp file. Quote Link to comment Share on other sites More sharing options...
eldon Posted December 13, 2013 Share Posted December 13, 2013 Go to lee-mac.com and download the polyjoin.lsp file. I hope that does what the OP wants, but I have a feeling that it is not quite what is wanted..... We shall see Quote Link to comment Share on other sites More sharing options...
rkent Posted December 13, 2013 Share Posted December 13, 2013 eldon, you are right, I see now where the OP wants closed plines. Sounds simple enough to make a macro, pedit;m;all;;join;;close;; Quote Link to comment Share on other sites More sharing options...
SLW210 Posted December 13, 2013 Share Posted December 13, 2013 What's problem with my request? It's difficult to write autolisp??? We are all here on a voluntary basis, demanding someone to write YOU a LISP is a bit presumptuous of you. Be Patient. eldon, you are right, I see now where the OP wants closed plines. Sounds simple enough to make a macro, pedit;m;all;;join;;close;; I don't believe that will work, the OP wants individual closed plines, the example shows they have a shared line, which would mean only a few would be as desired. Seems to me the OP is looking for a BPOLY command that would use a window selection instead of picking each point with Island Detection. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 13, 2013 Share Posted December 13, 2013 This simple program may speed up the process: (defun c:test ( / *error* c p ) (defun *error* ( msg ) (if (= 'int (type c)) (setvar 'cmdecho c)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (princ) ) (setq c (getvar 'cmdecho)) (setvar 'cmdecho 0) (while (setq p (getpoint "\nPick internal point: ")) (vl-cmdf "_.-boundary" "_a" "_o" "_p" "" "_non" p "") ) (setvar 'cmdecho c) (princ) ) Thanks for all the recommendations guys Quote Link to comment Share on other sites More sharing options...
ksxdqn Posted December 14, 2013 Author Share Posted December 14, 2013 This simple program may speed up the process: (defun c:test ( / *error* c p ) (defun *error* ( msg ) (if (= 'int (type c)) (setvar 'cmdecho c)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (princ) ) (setq c (getvar 'cmdecho)) (setvar 'cmdecho 0) (while (setq p (getpoint "\nPick internal point: ")) (vl-cmdf "_.-boundary" "_a" "_o" "_p" "" "_non" p "") ) (setvar 'cmdecho c) (princ) ) Thanks for all the recommendations guys Dear LeeMac, Thanks your help but i want quickly. not pick point. If i have milion lines or plines, it get many time from me. Can we pick point up left --->pick point down right to select all lines or polyline .Only step and result : to Closed - Polylines! Thanks Quote Link to comment Share on other sites More sharing options...
ksxdqn Posted December 14, 2013 Author Share Posted December 14, 2013 Hi everbody, I come from a country where English is not mother language. Maybe i have mistake in write my idea. All of people forgive me , plz. Thanks. My idea show in my drawing. I have many many closed-plines Step1 :Automatic Create point centroid closed polylines Step2 :Automatic Create numbering and area Step3: Automatic Split one by one parcel and publish it. (Contemporaneous ) Help me to write autolisp! Thanks everybody! Exp.dwg Quote Link to comment Share on other sites More sharing options...
ksxdqn Posted December 14, 2013 Author Share Posted December 14, 2013 Who will help me?? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 14, 2013 Share Posted December 14, 2013 Thanks your help but i want quickly. not pick point. Good luck! Quote Link to comment Share on other sites More sharing options...
CADTutor Posted December 14, 2013 Share Posted December 14, 2013 Good luck! I'm constantly surprised by the patience and forbearance that you guys show to even the most blunt requests. Really appreciate you being a part of this community - gold star for this thread. Quote Link to comment Share on other sites More sharing options...
ymg3 Posted December 14, 2013 Share Posted December 14, 2013 There is this bit of code by Marko Ribar. It will transform a Selection Set of lines to region. Once you have region It's probably easy to transform them in LWPolylines. It is not foolproof and you have to explode your polylines to lines. By the way, "Quickly" missed the train, so I'm afraid he'll be late! ymg ; Create regions in a grid of lines by Marko Ribar ; ; Will join the lines of a Voronoi Diagram into regions ; ; To be integrated in the Voronoi Generation routine ; (defun c:intlines2regions ( / *error* ms ss i lst ) (vl-load-com) (or acDoc (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))) (setq ms (vlax-get acDoc (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace))) (vla-startundomark acDoc) (defun *error* (msg) (and msg (not (wcmatch (strcase msg) "*CANCEL*,*QUIT*,*EXIT*")) (princ (strcat "\nError: " msg)) ) (vla-endundomark acDoc) (princ) ) (if (setq ss (ssget '((0 . "LINE")))) (progn (repeat (setq i (sslength ss)) (setq lst (cons (vlax-ename->vla-object (ssname ss (setq i (1- i)))) lst)) ) (vlax-invoke ms 'AddRegion lst) ) (princ "\nEmpty selection...Try again...") ) (vla-endundomark acDoc) (princ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 14, 2013 Share Posted December 14, 2013 Really appreciate you being a part of this community - gold star for this thread. Thank you David, that really means a lot coming from you Quote Link to comment Share on other sites More sharing options...
ksxdqn Posted December 14, 2013 Author Share Posted December 14, 2013 There is this bit of code by Marko Ribar. It will transform a Selection Set of lines to region. Once you have region It's probably easy to transform them in LWPolylines. It is not foolproof and you have to explode your polylines to lines. By the way, "Quickly" missed the train, so I'm afraid he'll be late! ymg ; Create regions in a grid of lines by Marko Ribar ; ; Will join the lines of a Voronoi Diagram into regions ; ; To be integrated in the Voronoi Generation routine ; (defun c:intlines2regions ( / *error* ms ss i lst ) (vl-load-com) (or acDoc (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))) (setq ms (vlax-get acDoc (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace))) (vla-startundomark acDoc) (defun *error* (msg) (and msg (not (wcmatch (strcase msg) "*CANCEL*,*QUIT*,*EXIT*")) (princ (strcat "\nError: " msg)) ) (vla-endundomark acDoc) (princ) ) (if (setq ss (ssget '((0 . "LINE")))) (progn (repeat (setq i (sslength ss)) (setq lst (cons (vlax-ename->vla-object (ssname ss (setq i (1- i)))) lst)) ) (vlax-invoke ms 'AddRegion lst) ) (princ "\nEmpty selection...Try again...") ) (vla-endundomark acDoc) (princ) ) Thanks ymg3. It true with series lines but failed with both lines and plines. Check again,plz. Be omitted some closed-plines! Many thanks! Quote Link to comment Share on other sites More sharing options...
ksxdqn Posted December 14, 2013 Author Share Posted December 14, 2013 @LeeMac. Help me! Quote Link to comment Share on other sites More sharing options...
Snownut Posted December 14, 2013 Share Posted December 14, 2013 Apparently the OP missed the purpose of this FORUM "TUTOR" (meaning to teach) not "FREE PROGRAMING" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.