Hi There,
I'm using AutoCAD Civil 3D to model inner city utility construction projects. For my research project, I need to include water and storm pipes, but also various sorts of cables. Currently, I'm manually creating cables profiles using plines from existing 2D drawings and the sweep function.. a very cumbersome taks.
I was wondering whether there is a way to speed this process up. At the moment, I draw a circle, copy it myriads of times, and sweep each along the dozens of plines (one by one). I cannot select multiple lines and sweep them all, can I?
I posed a this question: "Can anybody tell me whether I can select mutiple plines to sweep all at once?" and was directed at the following code in the civil3D forum.
(defun c:sweepm ()
(princ "\PSelect objects to sweep: ")
(setq pick1 (ssget))
(princ "\nSelect sweep paths: ")
(setq ss (ssget '((0 . "LINE,*POLYLINE,3dpoly"))))
(setq NumPath (sslength ss) Count 0)
(repeat NumPath
(setq Ename (ssname ss Count))
(command "sweep" pick1 "" Ename)
(repeat NumPath
(setq Count (+ 1 count))
)
(princ)
)
I tried to implement it via VLISP. However, although the selection features allow me to select multiple objects and plines, autocad eventually only sweeps one line. Does anybody know why?
Hi Kent,
Ill try to implement your suggested code, I've been away for a while. Again, thanks a lot for your help till so far!
Léon
I was wondering if this lisp could be adjusted to work with rectangles rather than circles by any chance?
Thanks!
@konrad.r.koltun wrote:
I was wondering if this lisp could be adjusted to work with rectangles rather than circles by any chance?
Thanks!
Hello Konrad and welcome to the Autodesk Community!
Can you be more specific concerning which code you want to modify,
Henrique
@joewainwright90 wrote:
Apologies, i think it was the second code that was posted
... still not quite clear to me which one -- if one of mine, are you talking about the code in Message 7? 19? 25? 32? Or someone else's?
Just saw this thread.
I realized four years ago the pipe network objects were not suited to production, so did routines that turn c3d alignments into 3d polys and sweep on them.
It allows both circles and rectangles, and works great.
The tool does suffer from the limitations of the sweep command.
Sweep does not like sharp angles and certain things I have not yet figured out.
So if you break the 3d poly at sharp points, it works on both but not if they are one.
to deal with that, we use:
(SETVAR "DELOBJ" 0)
(vl-catch-all-apply '(lambda () (COMMAND ".SWEEP" CIRCENAME "" PL-ENAME)))
so it does not crash the routine.
see pics of what we do.
Believe me, pipe networks are rediculous compared to making pipes like this.
Notice the pipes keep going in the distance. That is about 1/10th of what we did complete with bridges and so on.
3D modeling is easy, its C3D that makes it hard if you try to do all that.
internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties
@joewainwright90 wrote:
I was also wondering if the code could be altered to allow a rectangular polyline to be used as the object to sweep (by either selecting the polyline to use or entering values for the length/width of the recangular polyline)
....
For a square section, see TubeSquare.lsp with its TUBESQ command, here. There are some caveats described there. I may do a version that asks for rectangle length and width, some day soon....
@Kent1Cooper wrote:
For a square section, see TubeSquare.lsp with its TUBESQ command, here. There are some caveats described there. I may do a version that asks for rectangle length and width, some day soon....
Here's a Rectangle version, subject to the same caveats about orientation of the rectangle for paths that don't lie nicely in (or parallel to) the WCS plane.
what is the advantage of extrude instead of sweep?
I thought sweep dealt with keeping the shape normal to the 3d pline as it goes along.
Also, sweep does not need a rectangle drawn in same plane as start of 3d pline. Seems like extrude is a hassle to me.
Are you trying to control the "twist" that sweep will do just a bit? Its almost not noticable though.
internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties
@jmaeding wrote:
what is the advantage of extrude instead of sweep?
I thought sweep dealt with keeping the shape normal to the 3d pline as it goes along.
Also, sweep does not need a rectangle drawn in same plane as start of 3d pline. Seems like extrude is a hassle to me.
Are you trying to control the "twist" that sweep will do just a bit? Its almost not noticable though.
The "advantage" is only that I have an older version of AutoCAD here, without the Sweep command. I imagine it wouldn't be hard for somebody to adjust it to use that command, but I can't test it here.
oh, minor detail 🙂
Bricscad 14.2 just got the command, 13 did not have it.
I keep looking for a way to get around the fact that sweep fails here and there.
It locks up acad sometimes too for some reason.
What I plan to do is write a .net routine that creates the swept solid so I can error catch better.
If it fails, I can have it try to locate the fail point(s) but I do not understand why they fail yet.
If we could make extrude do the job, or some other method like lofting a bunch of circles, I am open to it if it was more dependable.
internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties