Didn't someone (Lee Mac?) write a lisp routine that did something similar to this? Sorry, just can't recall for sure. Check around.
Registered forum members do not see this ad.
hi all,
could anyone tell me if there is a command to split a line into segments?
i know there is the divide command but that does not physically split the line, it just gives it points. i need the line to be seperate segments without the gap like the break command gives.
sorry if i'm not too clear on this, its hard to put into words
cheers
Steven
"Leave it on the doorstep and get the hell outta here!"
Didn't someone (Lee Mac?) write a lisp routine that did something similar to this? Sorry, just can't recall for sure. Check around.
"I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police
Eat brains...gain more knowledge!


try this one. It seems to work




The ._BREAK command doesn't leave a gap if you break it at a single point. Use the "@" character to specify the second point.
Command: ._BREAK
Select object:
Specify second break point or [First point]: _F
Specify first break point: <specify point>
Specify second break point: @
Command:




"You are entitled to your own opinion but you are not entitled to your own facts." Daniel Patrick Moynihan
RKMcSwain´s answer worked perfect for me.
thanks, love you guys out there!




Also brillance by Lee Mac
Code:;;------------------------=={ Segs }==------------------------;; ;; ;; ;; Divides selected objects into an LWPolyline with a ;; ;; specified number of segments ;; ;;------------------------------------------------------------;; ;; Author: Lee McDonnell, 2010 ;; ;; ;; ;; Copyright © 2010 by Lee McDonnell, All Rights Reserved. ;; ;; Contact: Lee Mac @ TheSwamp.org, CADTutor.net ;; ;;------------------------------------------------------------;; (defun c:Segs ( / *error* _StartUndo _EndUndo doc ss ) (vl-load-com) ;; © Lee Mac 2010 (defun *error* ( msg ) (and doc (_EndUndo doc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ) ) (defun _StartUndo ( doc ) (_EndUndo doc) (vla-StartUndoMark doc) ) (defun _EndUndo ( doc ) (if (= 8 (logand 8 (getvar 'UNDOCTL))) (vla-EndUndoMark doc) ) ) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)) *segs (cond ( *segs ) ( 10 ))) (if (and (setq ss (ssget "_:L" '((0 . "ARC,CIRCLE,LWPOLYLINE,SPLINE,LINE,ELLIPSE")))) (progn (initget 6) (setq *segs (cond ((getint (strcat "\nSpecify Number of Segments <" (itoa *segs) "> : "))) ( *segs ))) ) ) ( (lambda ( j / e inc i pts ) (_StartUndo doc) (while (setq e (ssname ss (setq j (1+ j)))) ( (lambda ( inc i / pts ) (repeat (1+ *segs) (setq pts (cons (trans (vlax-curve-getPointatDist e (* (setq i (1+ i)) inc)) 0 e) pts)) ) (if (entmake (append (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (cons 90 (length pts)) (cons 38 (caddar pts)) (cons 70 0) ) (vl-remove-if 'null (mapcar (function (lambda ( d ) (assoc d (entget e)))) '(6 8 39 48 210) ) ) (mapcar (function (lambda ( a ) (cons 10 a))) pts) ) ) (entdel e) ) ) (/ (vlax-curve-getDistatParam e (vlax-curve-getEndParam e)) (float *segs)) -1 ) ) (_EndUndo doc) ) -1 ) ) (princ) )
Registered forum members do not see this ad.
I don't know about AutoCAD 2012 or Civil 3D, but in Autodesk Inventor the command for splitting a line is called, well, Split....This works fine although I am wondering if there is a built in function in AutoCad 2012 or Civil 3D 2012 that does this yet?
Certified SolidWorks Professional
Autodesk Inventor 2013 Certified Professional
Autodesk AutoCAD 2013 Certified Professional
http://home.pct.edu/~jmather/content..._Tutorials.htm
Bookmarks