azman Posted June 25, 2008 Share Posted June 25, 2008 Hi, i have 2D polylines and want to convert to polylines, but to no avail. Anyone? tried to 'spline2pline' this line, but ACAD refuse to select it. Tq 2dpl.dwg Quote Link to comment Share on other sites More sharing options...
nocturne00 Posted June 25, 2008 Share Posted June 25, 2008 can you elaborate more? a 2D polyline is the same as a polyline. now a 3d polyline is the one different from a 2dpolyline/ polyline Quote Link to comment Share on other sites More sharing options...
SEANT Posted June 25, 2008 Share Posted June 25, 2008 The CONVERTPOLY command will transform a 2DPoly(Heavy) to a LightWeight Poly(Light) or vice versa. Quote Link to comment Share on other sites More sharing options...
inevelus Posted March 20, 2009 Share Posted March 20, 2009 2d polylines are definitely NOT the exact same as polylines. very close though. draw a 2d polyline and a regular polyline and try to offset both of them and see what happens. the 2d will remain a 2d polyline but will now have about 10 times as many handles making it a little unmanageable for editing. the polyline will keep the same amount and spacing of handle. a 2d polyline wil take up more memory than a regular polyline, as the vertex information is stored differently. the current 2d polyline system is how all 2d polylines used to be stored, and cad moved towards the newer way, "regular polylines" to cut down on memory use and regen time. most importantly, i think we can all agree that splines suck. Quote Link to comment Share on other sites More sharing options...
SEANT Posted March 20, 2009 Share Posted March 20, 2009 most importantly, i think we can all agree that splines suck. That does seem to be the prevailing opinion, though I’m not sure why. Quote Link to comment Share on other sites More sharing options...
Tankman Posted March 21, 2009 Share Posted March 21, 2009 Originally Posted by inevelus Most importantly, i think we can all agree that splines suck. Originally Posted by SEANT "That does seem to be the prevailing opinion, though I’m not sure why." Is there a command to change a spline to a polyline? Quote Link to comment Share on other sites More sharing options...
SEANT Posted March 21, 2009 Share Posted March 21, 2009 The Express Tools FLATTEN command will convert splines to polylines, though that may not be useful if the 3D geometry must be maintained. I have not seen a routine to convert a 3 dimensional Spline to a 3dPolyline but imagine it would be fairly straightfoward to write. Quote Link to comment Share on other sites More sharing options...
titashtalukdar Posted March 24, 2009 Share Posted March 24, 2009 At this I tried the Drawing, The Lines Exploded by typing Explode and then PEDIT it, andf it will join and make it into a polyline Quote Link to comment Share on other sites More sharing options...
camilocm Posted July 9, 2009 Share Posted July 9, 2009 The Express Tools FLATTEN command will convert splines to polylines, though that may not be useful if the 3D geometry must be maintained. I have not seen a routine to convert a 3 dimensional Spline to a 3dPolyline but imagine it would be fairly straightfoward to write. To convert Spline to 3d polyline: Save as DXF and then re-open, all spline will be 3d polyline dxf 12 will work, i don´t know other versions Quote Link to comment Share on other sites More sharing options...
SEANT Posted July 10, 2009 Share Posted July 10, 2009 Good Suggestion. And, welcome to the forum. Quote Link to comment Share on other sites More sharing options...
psych Posted July 31, 2009 Share Posted July 31, 2009 (edited) Try this.. (defun spline-to-pline (/ i) (vl-load-com) (setq *thisdrawing* (vla-get-activedocument (vlax-get-acad-object) ) ;_ end of vla-get-activedocument *modelspace* (vla-get-ModelSpace *thisdrawing*) ) ;_ end of setq (setq spline-list (get-spline)) (setq i (- 1)) (if spline-list (progn (setq msg "\nNumber of segments <100>: ") (initget 6) (setq num (getint msg)) (if (or (= num 100) (= num nil)) (setq num 100) ) ;_ end of if (repeat (length spline-list) (setq splobj (nth (setq i (1+ i)) spline-list)) (convert-spline splobj num) ) ;_ end of repeat ) ;_ end of progn ) ;_ end of if ) ;_ end of spline-to-pline (defun get-spline (/ spl-list obj spline no-ent i) (setq spl-list nil obj nil spline "AcDbSpline" selsets (vla-get-selectionsets *thisdrawing*) ss1 (vlax-make-variant "ss1") ) ;_ end of setq (if (= (vla-get-count selsets) 0) (setq ssobj (vla-add selsets ss1)) ) ;_ end of if (vla-clear ssobj) (setq no-ent 1) (while no-ent (prompt "\nSelect splines: ") (vla-Selectonscreen ssobj) (if (> (vla-get-count ssobj) 0) (progn (setq no-ent nil) (setq i (- 1)) (repeat (vla-get-count ssobj) (setq obj (vla-item ssobj (vlax-make-variant (setq i (1+ i))) ) ;_ end of vla-item ) ;_ end of setq (cond ((= (vlax-get-property obj "ObjectName") spline) (setq spl-list (append spl-list (list obj)) ) ;_ end of setq ) ) ;_ end-of cond ) ;_ end of repeat ) ;_ end of progn (prompt "\nNo entities selected, try again.") ) ;_ end of if (if (and (= nil no-ent) (= nil spl-list)) (progn (setq no-ent 1) (prompt "\nNo splines selected.") (quit) ) ;_ end of progn ) ;_ end of if ) ;_ end of while (vla-delete (vla-item selsets 0)) spl-list ) ;_ end of get-spline (defun convert-spline (splobj n / i) (setq point-list nil 2Dpoint-list nil z-list nil spl-lyr (vlax-get-property splobj 'Layer) startSpline (vlax-curve-getStartParam splobj) endSpline (vlax-curve-getEndParam splobj) i (- 1) ) ;_ end of setq (repeat (+ n 1) (setq i (1+ i)) (setq p (vlax-curve-getPointAtParam splobj (* i (/ (- endspline startspline) n) ) ;_ end of * ) ;_ end of vlax-curve-getPointAtParam ) ;_ end of setq (setq 2Dp (list (car p) (cadr p)) 2Dpoint-list (append 2Dpoint-list 2Dp) point-list (append point-list p) z (caddr p) z-list (append z-list (list z)) ) ;_ end of setq ) ;_ end of repeat (setq summ (apply '+ z-list)) (setq arraySpace (vlax-make-safearray vlax-vbdouble ; element type (cons 0 (- (length point-list) 1) ) ; array dimension ) ;_ end of vlax-make-safearray ) ;_ end of setq (setq vert-array (vlax-safearray-fill arraySpace point-list)) (vlax-make-variant vert-array) (if (and (= :vlax-true (vlax-get-property splobj 'IsPLanar)) (= summ 0.0) ) ;_ end of and (setq plobj (add-polyline 2Dpoint-list vla-AddLightweightPolyline ) ;_ end of add-polyline ) ;_ end of setq (setq plobj (add-polyline point-list vla-Add3DPoly ) ;_ end of add-polyline ) ;_ end of setq ) ;_ end of if (vlax-put-property plobj 'Layer spl-lyr) (vla-delete splobj) (vlax-release-object splobj) ) ;_ end of convert-spline (defun add-polyline (pt-list poly-func) (setq arraySpace (vlax-make-safearray vlax-vbdouble (cons 0 (- (length pt-list) 1) ) ; array dimension ) ;_ end of vlax-make-safearray ) ;_ end of setq (setq vertex-array (vlax-safearray-fill arraySpace pt-list) ) ;_ end of setq (vlax-make-variant vertex-array) (setq plobj (poly-func *modelspace* vertex-array ) ;_ end of poly-func ) ;_ end of setq ) ;_ end of add-polyline (defun c:s2p () (spline-to-pline) (princ) ) ;_ end of c:s2p (prompt "SPLINE-TO-PLINE by Tony Hotchkiss. Enter S2P to start" ) ;_ end of prompt Edited December 7, 2012 by SLW210 Add Code Tags! Quote Link to comment Share on other sites More sharing options...
McWaters12 Posted January 23, 2011 Share Posted January 23, 2011 When I try to convert a 2d polyline to a regular polyline, it then asks me to choose between options like 'open' 'fit' 'close'. I'm not really sure which one to choose. I have been choosing 'open' but then it's like i have to choose it thousands of times. I don't know what is going on. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted January 26, 2011 Share Posted January 26, 2011 To get out of the pedit you should hit enter or escape. Quote Link to comment Share on other sites More sharing options...
shrimpbiscuits Posted December 7, 2012 Share Posted December 7, 2012 Try using overkill. It worked for me. I learned it from a good friend, a legend in the CAD industry that goes by the name candymountain. Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 7, 2012 Share Posted December 7, 2012 shrimp: You're suggesting the use of Overkill to obtain what end result? Quote Link to comment Share on other sites More sharing options...
shrimpbiscuits Posted December 7, 2012 Share Posted December 7, 2012 It will convert 2d polylines to polylines Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 7, 2012 Share Posted December 7, 2012 Well let's hope the OP did not wait until June 2008 for an answer. But it will prove useful to others with the same question. You're in the running for today's prize for the person that resurrects the oldest thread. 4 years 6 months. LoL Quote Link to comment Share on other sites More sharing options...
shrimpbiscuits Posted December 7, 2012 Share Posted December 7, 2012 Haha, yeah I know its old as hell but I did a search on google and couldnt find any answers on it so when I found this thread I joined today to make sure the answer is out there for anyone who may need it in the future. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted December 7, 2012 Share Posted December 7, 2012 It will convert 2d polylines to polylines OVERKILL doesn't work here to convert 2D Polyline to Polyline. CONVERTPOLY works just fine as does PEDIT. Quote Link to comment Share on other sites More sharing options...
shrimpbiscuits Posted December 7, 2012 Share Posted December 7, 2012 Neither one of those worked for me for converting from 2d to a regular poly but overkill did just what I needed for some reason. 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.