iuliandonici Posted May 18, 2011 Share Posted May 18, 2011 (edited) I have an Autocad 2008 drawing with layers that have 2D lines, and I need to change every single one of those lines into 3D polylines. Is there a LSP for this kind of work? Does anyone have any idea how to convert these layers which have 2D lines to layers that have 3D lines? Thank you. Edited May 18, 2011 by iuliandonici Quote Link to comment Share on other sites More sharing options...
ReMark Posted May 18, 2011 Share Posted May 18, 2011 Best I can find at the moment: http://www.black-cad.homepage.t-online.de/pediten.htm Quote Link to comment Share on other sites More sharing options...
Organic Posted May 18, 2011 Share Posted May 18, 2011 How would you convert it without knowing Z1 and Z2 the Z values of the endpoints of each line? Quote Link to comment Share on other sites More sharing options...
eldon Posted May 18, 2011 Share Posted May 18, 2011 In AutoCAD all 2D lines are in fact 3D lines that happen to have the z value of 0. Quote Link to comment Share on other sites More sharing options...
qball Posted May 18, 2011 Share Posted May 18, 2011 In AutoCAD all 2D lines are in fact 3D lines that happen to have the z value of 0. from help menu: "A 3D polyline is a connected sequence of straight line segments created as a single object. 3D polylines can be non-coplanar; however, they cannot include arc segments." 2d polylines can not be non-coplanar Quote Link to comment Share on other sites More sharing options...
eldon Posted May 18, 2011 Share Posted May 18, 2011 2d polylines can not be non-coplanar That is why I mentioned only Lines, as the OP asked about. 2d polylines can have a z value, as long as it is the same value throughout. Does this make them 3D? Quote Link to comment Share on other sites More sharing options...
eldon Posted May 18, 2011 Share Posted May 18, 2011 Perhaps the OP would give out a little more information, like where will the 3D information be coming from? Quote Link to comment Share on other sites More sharing options...
Tyke Posted May 18, 2011 Share Posted May 18, 2011 That is why I mentioned only Lines, as the OP asked about. 2d polylines can have a z value, as long as it is the same value throughout. Does this make them 3D? When you select polyline from the toolbox you draw a LWPolyline not a 2D Polyline and LWPolylines ony have X and Y coordinates. LWPolylines can be converted to 2D polylines, I think the command is CONVERT. We use mostly Civil 3D for our 3D work and it has a function to convert 2D Polylines into 3D Polylines, but that doesn't help the OP as it looks as if he's just using AutoCAD. Somewhere I have a VBA that converts 2D Polys to 3D Polys, if any body wants it. Quote Link to comment Share on other sites More sharing options...
qball Posted May 18, 2011 Share Posted May 18, 2011 That is why I mentioned only Lines, as the OP asked about. 2d polylines can have a z value, as long as it is the same value throughout. Does this make them 3D? ah, I suppose if I read correctly that would help. Changing from line to 2d polyline is a simple step of Pedit. I don't know what to do after that. Quote Link to comment Share on other sites More sharing options...
ReMark Posted May 18, 2011 Share Posted May 18, 2011 There is at least one lisp routine I know of that converts a 2Dpolyline to a 3Dpolyline. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted May 18, 2011 Share Posted May 18, 2011 See if this helps..... 2d-lines-polylines-to-3d-polylines Quote Link to comment Share on other sites More sharing options...
iuliandonici Posted May 19, 2011 Author Share Posted May 19, 2011 (edited) I would like to thank all of you but this is not what I need. My lines don't have any arcs, there are not (2D) polylines. What I need is probably a routine that knows how to convert a layer full of 2D lines into 3D polylines - I can't stay and select every single 2D line because I have thousands of them on each layer (around 5 layers) so I need something consistent. Please, it would mean a lot to me and as frustrating as it is, my job is on the line. The thing is, I was asked to work on a 3D project, drawing some cable trays. It was told to me, I just have to draw some lines. That sounded pretty ok to me so I started drawing line for about two weeks. Now, I've been told my drawing will somehow be exported and used in another program that doesn't know how to "scan" for simple (2D) lines, ONLY 3D polylines. I have searched over the web, nothing so far. There are more 3D to 2D LISP routines out there but those are not helping me. Edited May 19, 2011 by iuliandonici 3D poylines, 2d lines, 2D to 3D polylines routine Quote Link to comment Share on other sites More sharing options...
fuccaro Posted May 19, 2011 Share Posted May 19, 2011 (edited) Iulian Try this quick and dirty Lisp routine. There is no layering and it will delete the initial lines. Make a copy of your drawing before you use this Lisp. (defun c:ltp() (setq ss (ssget "X" '((0 . "LINE")))) (repeat (setq i (sslength ss)) (setq e (ssname ss (setq i (1- i))) el (entget e)) (setq a (cdr (assoc 10 el)) b (cdr (assoc 11 el))) (command "3dpoly" a b "") (entdel e) ) ) I don't have AutoCAD right now, I gave it a quick test in Bricscad. I forgot this: TURN OFF THE OSNAP PRIOR TO USE IT !!! Edited May 19, 2011 by fuccaro adding Osnap warning Quote Link to comment Share on other sites More sharing options...
iuliandonici Posted May 19, 2011 Author Share Posted May 19, 2011 What's the command? :"> . Sorry, I've just seen it. I'll put some feedback in a minute. Quote Link to comment Share on other sites More sharing options...
iuliandonici Posted May 19, 2011 Author Share Posted May 19, 2011 @fuccaro: Ok. So, I have loaded the lisp, typed "3dpoly" and it says to pick a starting point and then a second point and that's it. But I don't want to CREATE a 3D Polyline. I just need to convert the 2D ones into 3Ds. Or, maybe I don't know how to use your lisp properly. Where could I be wrong? Quote Link to comment Share on other sites More sharing options...
iuliandonici Posted May 19, 2011 Author Share Posted May 19, 2011 I have bumped into GEOTOOLS. This piece of software does EXACTLY what I wanted. THe only disapointing thing is that it's not FREE and it has a limited uses of its commands. Quote Link to comment Share on other sites More sharing options...
eldon Posted May 19, 2011 Share Posted May 19, 2011 (edited) The command 3Dpoly is the AutoCAD tool which creates a 3D polyline one point at a time which is patently what you wish to avoid. There are lisps available by searching the Forum, which will convert into 3D polylines, but then you will have a 3D polyline with a z value of zero. Perhaps that is what you want, but for most people, the whole point of making a 3D polyline is to have something which is in 3D and not just along zero. Edited May 19, 2011 by eldon Quote Link to comment Share on other sites More sharing options...
ReMark Posted May 19, 2011 Share Posted May 19, 2011 What's the command? :"> . Sorry, I've just seen it. I'll put some feedback in a minute. The command for fuccaro's lisp routine is NOT 3Dpoly. It is the three letters that appear after defun c: which happens to be lpt. Try again. Quote Link to comment Share on other sites More sharing options...
iuliandonici Posted May 19, 2011 Author Share Posted May 19, 2011 @ReMark: I'm just dumb. Thank you. @fuccaro Command: 3dpoly Specify start point of polyline: Specify endpoint of line or [undo]: Specify endpoint of line or [undo]: Command: 3dpoly Specify start point of polyline: Specify endpoint of line or [undo]: Specify endpoint of line or [undo]: Command: 3dpoly And I thought I was on the right track. The thing is, this routine has converted indeed my 2D lines to 3DPolylines but it also converted my 5 layers into 1 layer (the default layer). I can't use it. I need my layers to be intact, same names, colors. Quote Link to comment Share on other sites More sharing options...
ReMark Posted May 19, 2011 Share Posted May 19, 2011 In other words, don't give you what you asked for. Give you what you need? You can't run the routine one layer at a time and freeze the others? 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.