sk1nn3r Posted June 22, 2009 Posted June 22, 2009 Hi all, Maybe one of u can help me, i have a 2d (x,y) autocad drawing. But i need to break te lines at a specified point. I got two line lines each about 5.7 KM the both lines are drawed as one unbreaked line. Now i need to break it each 990m, does anyone can explaine me how i break at specified distance. Cuz i know the break but then u need to know where it is. But my Lines arent straight ahead so i cant just measure it. I kinda need a command with specifies a start point and break at second point 990meters. Hope u guys can help me out . I looked at the Forum and all kinda lips i tried to use but it wont solve my problem. Maybe its a dumb question but u guys will help me out. Regards Marcel Quote
dbroada Posted June 22, 2009 Posted June 22, 2009 do you NEED to break it or just mark it? You can use the (I think) MEASURE or DIVIDE commands to mark it every XXXX. You could of couse use these commands to mark the line and then manually break it at those points or use a LISP routine to achieve the same result. Quote
sk1nn3r Posted June 22, 2009 Author Posted June 22, 2009 Hi dave, first thanks of replying my thread. Marking is good enough for me cus i know the way to manualy break it. But it wont get me put the point at specified lenght :S. Maybe u know a way to use divide or measure. If i use measure it can only use straight lines nog curves etc.. Maybe i do something wrong. Thanks for your help. Regards Marcel Quote
dbroada Posted June 22, 2009 Posted June 22, 2009 I have only tried on an arc and measure worked fine on that. Select the curve and type in the distance. Don't forget to make PDMODE something like 2 so that you can see the points. Quote
Lee Mac Posted June 22, 2009 Posted June 22, 2009 This should do the trick - works on all curves (Arcs, Lines, Polylines...) Assuming your drawings units are set to metres, this will break at every 990 units. (defun c:brkcurv (/ *error* vl ov dis cEnt pt) (vl-load-com) (setq dis 990.) (defun *error* (msg) (if ov (mapcar 'setvar vl ov)) (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")) (princ (strcat "\n<< Error: " msg " >>"))) (princ)) (setq vl '("CMDECHO" "OSMODE") ov (mapcar 'getvar vl)) (mapcar 'setvar vl '(0 0)) (while (and (setq cEnt (car (entsel "\nSelect Curve to Break: "))) (vl-position (cdadr (entget cEnt)) '("LINE" "LWPOLYLINE" "POLYLINE" "ARC" "SPLINE"))) (while (and (setq pt (vlax-curve-getPointatDist cEnt dis)) (>= (distance pt (vlax-curve-getEndPoint cEnt)) dis)) (command "_.break" (list cEnt pt) "_F" pt pt) (setq cEnt (entlast)))) (mapcar 'setvar vl ov) (princ)) Quote
Lee Mac Posted June 22, 2009 Posted June 22, 2009 I thought you might be along Lee. Well, to be honest, I don't really like writing LISPs to break objects as there is no specific "break" method in LISP, and you have to opt for a command-call - which is unreliable imo. If you avoid the command-call, the amount of coding needed is ridiculous... But on this one I couldn't resist Quote
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.