Jump to content

Autocad 2008 - turn simple lines (2D) to 3D lines


iuliandonici

Recommended Posts

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 by iuliandonici
Link to comment
Share on other sites

  • Replies 28
  • Created
  • Last Reply

Top Posters In This Topic

  • iuliandonici

    10

  • eldon

    5

  • fuccaro

    4

  • ReMark

    4

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by iuliandonici
3D poylines, 2d lines, 2D to 3D polylines routine
Link to comment
Share on other sites

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 by fuccaro
adding Osnap warning
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Edited by eldon
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...