termal007 Posted June 21, 2013 Share Posted June 21, 2013 hi i have a polyline 1254.85 meters ; i want insert point on polyline intervals 15 meters and 15 meters . how can i do that is simple ? this polyline is alignment road . Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 21, 2013 Share Posted June 21, 2013 Did you try the command divide with Block option ? Quote Link to comment Share on other sites More sharing options...
nestly Posted June 21, 2013 Share Posted June 21, 2013 I think it would be MEASURE command for known distance intervals Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 21, 2013 Share Posted June 21, 2013 I think it would be MEASURE command for known distance intervals You're right , I was although not sure of the divide command Quote Link to comment Share on other sites More sharing options...
termal007 Posted June 21, 2013 Author Share Posted June 21, 2013 oh yes but when distance is 125.63 and u want to 30 intervals u should 4.187666666667 divided so u should type in command is 4 or 5 dived in Autocad !! so betweens points are not 30 because u divide 4 or 5 used not intervales likes!! for example : polyline is 125.63 ; i like divide between length of points are 30 so i divide 125.63/30 = 4.1876666666666666666666666666667 ;; ok !! but i should type in autocad command divide and number use 4 or 5 so when i use 4 or 5 raen't correct between points are 30 and 30 !! lenghth betwwen points are 25.126 for 5 divide Quote Link to comment Share on other sites More sharing options...
termal007 Posted June 21, 2013 Author Share Posted June 21, 2013 You're right , I was although not sure of the divide command thanks that's answer my question http://www.cadtutor.net/forum/images/smilies/thumbsup.gif Quote Link to comment Share on other sites More sharing options...
CADgirl Posted June 21, 2013 Share Posted June 21, 2013 Maybe I'm not understanding what you're asking, but why can't you just use array? Quote Link to comment Share on other sites More sharing options...
nestly Posted June 21, 2013 Share Posted June 21, 2013 ... why can't you just use array? Assuming the profile is correct --> Quote Link to comment Share on other sites More sharing options...
CADgirl Posted June 21, 2013 Share Posted June 21, 2013 Assuming the profile is correct --> [ATTACH=CONFIG]42568[/ATTACH] Up until recently I was using 2007 and it had the array command. (assuming that's what you were alluding to. I could be missing something though.) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 21, 2013 Share Posted June 21, 2013 Up until recently I was using 2007 and it had the array command. (assuming that's what you were alluding to. I could be missing something though.) Array can not do the trick since that it is not walking along the distance of line segments , so try the measure command as Nestly 's suggested to see the differences . Quote Link to comment Share on other sites More sharing options...
nestly Posted June 21, 2013 Share Posted June 21, 2013 Yes, I was alluding to ARRAY only being available as Rectangular and Polar until 2012, when Path Array was added. Quote Link to comment Share on other sites More sharing options...
rkent Posted June 21, 2013 Share Posted June 21, 2013 The polyline is probably not a single straight length so array won't work. Measure should be the way to go, using a block. Quote Link to comment Share on other sites More sharing options...
termal007 Posted June 22, 2013 Author Share Posted June 22, 2013 The polyline is probably not a single straight length so array won't work. Measure should be the way to go, using a block. that's right ! i accept Quote Link to comment Share on other sites More sharing options...
Guest Posted June 22, 2013 Share Posted June 22, 2013 I have this lisp to do this... (defun c:cmeasure ( / *error* _StartUndo _EndUndo _SelectIf _IsCurveObject acdoc al bl d0 di en mx nm pt ) (defun *error* ( msg ) (if acdoc (_EndUndo acdoc)) (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) ) ) (defun _SelectIf ( msg pred func / sel ) (setq pred (eval pred)) (while (progn (setvar 'ERRNO 0) (setq sel (car (func msg))) (cond ( (= 7 (getvar 'ERRNO)) (princ "\nMissed, Try again.") ) ( (eq 'ENAME (type sel)) (if (and pred (not (pred sel))) (princ "\nInvalid Object Selected.") ) ) ) ) ) sel ) (defun _IsCurveObject ( entity / param ) (and (not (vl-catch-all-error-p (setq param (vl-catch-all-apply 'vlax-curve-getendparam (list entity)) ) ) ) param ) ) (setq acdoc (vla-get-activedocument (vlax-get-acad-object)) nm (trans '(0. 0. 1.) 1 0 t) ) (if (setq en (_SelectIf "\nSelect Object to Measure: " '_isCurveObject entsel)) (progn (initget 7 "Block") (setq di (getdist "\nSpecify length of segment or [block]: ")) (if (eq "Block" di) (progn (while (progn (setq bl (getstring t "\nEnter name of block to insert: ")) (cond ( (not (snvalid bl)) (princ "\nInvalid block name.") ) ( (not (tblsearch "BLOCK" bl)) (princ (strcat "\nCannot find block \"" bl "\".")) ) ) ) ) (initget "Yes No") (setq al (not (eq "No" (getkword "\nAlign block with object? [Yes/No] <Y>: ")))) (initget 7) (setq di (getdist "\nSpecify length of segment: ")) ) ) (setq mx (vlax-curve-getdistatparam en (vlax-curve-getendparam en)) d0 (- (/ (- mx (* di (fix (/ mx di)))) 2.) di) ) (_StartUndo acdoc) (while (and (<= (setq d0 (+ d0 di)) mx) (setq pt (vlax-curve-getpointatdist en d0))) (if bl (entmakex (list (cons 0 "INSERT") (cons 2 bl) (cons 10 (trans pt 0 nm)) (cons 50 (if al (angle '(0. 0. 0.) (trans (vlax-curve-getfirstderiv en (vlax-curve-getparamatpoint en pt)) 0 nm ) ) 0. ) ) (cons 210 nm) ) ) (entmakex (list (cons 0 "POINT") (cons 10 pt))) ) ) (_EndUndo acdoc) ) (princ "\n*Cancel*") ) (princ) ) (vl-load-com) (princ) ;;------------------------------------------------------------;; ;; End of File ;; ;;------------------------------------------------------------;; cheers Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 22, 2013 Share Posted June 22, 2013 I have this lisp to do this... (defun c:cmeasure ( / *error* _StartUndo _EndUndo _SelectIf _IsCurveObject acdoc al bl d0 di en mx nm pt ) (defun *error* ( msg ) (if acdoc (_EndUndo acdoc)) (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) ) ) (defun _SelectIf ( msg pred func / sel ) (setq pred (eval pred)) (while (progn (setvar 'ERRNO 0) (setq sel (car (func msg))) (cond ( (= 7 (getvar 'ERRNO)) (princ "\nMissed, Try again.") ) ( (eq 'ENAME (type sel)) (if (and pred (not (pred sel))) (princ "\nInvalid Object Selected.") ) ) ) ) ) sel ) (defun _IsCurveObject ( entity / param ) (and (not (vl-catch-all-error-p (setq param (vl-catch-all-apply 'vlax-curve-getendparam (list entity)) ) ) ) param ) ) (setq acdoc (vla-get-activedocument (vlax-get-acad-object)) nm (trans '(0. 0. 1.) 1 0 t) ) (if (setq en (_SelectIf "\nSelect Object to Measure: " '_isCurveObject entsel)) (progn (initget 7 "Block") (setq di (getdist "\nSpecify length of segment or [block]: ")) (if (eq "Block" di) (progn (while (progn (setq bl (getstring t "\nEnter name of block to insert: ")) (cond ( (not (snvalid bl)) (princ "\nInvalid block name.") ) ( (not (tblsearch "BLOCK" bl)) (princ (strcat "\nCannot find block \"" bl "\".")) ) ) ) ) (initget "Yes No") (setq al (not (eq "No" (getkword "\nAlign block with object? [Yes/No] <Y>: ")))) (initget 7) (setq di (getdist "\nSpecify length of segment: ")) ) ) (setq mx (vlax-curve-getdistatparam en (vlax-curve-getendparam en)) d0 (- (/ (- mx (* di (fix (/ mx di)))) 2.) di) ) (_StartUndo acdoc) (while (and (<= (setq d0 (+ d0 di)) mx) (setq pt (vlax-curve-getpointatdist en d0))) (if bl (entmakex (list (cons 0 "INSERT") (cons 2 bl) (cons 10 (trans pt 0 nm)) (cons 50 (if al (angle '(0. 0. 0.) (trans (vlax-curve-getfirstderiv en (vlax-curve-getparamatpoint en pt)) 0 nm ) ) 0. ) ) (cons 210 nm) ) ) (entmakex (list (cons 0 "POINT") (cons 10 pt))) ) ) (_EndUndo acdoc) ) (princ "\n*Cancel*") ) (princ) ) (vl-load-com) (princ) ;;------------------------------------------------------------;; ;; End of File ;; ;;------------------------------------------------------------;; cheers Where did you get that lisp from ? it has an end without a header Quote Link to comment Share on other sites More sharing options...
Guest Posted June 22, 2013 Share Posted June 22, 2013 i dont remember Tharwat ... 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.