PDA

View Full Version : changing the length of a polyline segment



tany0070
2007-05-09, 03:23 AM
hi pple,

anyone know what i must do so that i can adjust the length of a polyline segment?
an example is if my polyline has 3 line segments, and i wish to alter the length of the 2 unbounded segments, i.e the 2 with an open end, to a certain length but keeping the position of the polyline at the middle segment. please assist, thanks in advance.

Adesu
2007-05-09, 06:43 AM
hi pple,

anyone know what i must do so that i can adjust the length of a polyline segment?
an example is if my polyline has 3 line segments, and i wish to alter the length of the 2 unbounded segments, i.e the 2 with an open end, to a certain length but keeping the position of the polyline at the middle segment. please assist, thanks in advance.

Hi tany,
I hope this code would help you, I' m not sure as your request.


; evp is stand for Edit Vertices Polyline
; Design by : Adesu <Ade Suharna>
; Email : mteybid@yuasabattery.co.id
; Homepage : http://www.yuasa-battery.co.id
; Create : 09 May 2007
; Program no.: 0574/05/2007
; Edit by :

(defun massoc (key alist / x nlist) ; Jaysen Long
(foreach x alist
(if
(eq key (car x))
(setq nlist (cons (cdr x) nlist))
)
)
(reverse nlist)
)


(defun c:evp (/ des lst oom opt pt ss sse x x1 xlst y y1)
(if
(setq ss (entsel "\nPick an object polyline"))
(progn
(setq pt (cadr ss))
(setq sse (entget (car ss)))
(setq oom (getvar "osmode"))
(setvar "osmode" 33)
(setq opt (osnap (getpoint "\nSelect vertice location to edit") "int,end"))
(setq opt (list (car opt)(cadr opt)))
(setq des (getpoint opt "\nClick new location: "))
(setq des (list (car des)(cadr des)))
(setvar "osmode" oom)
(setq lst (massoc 10 sse))
(setq x (member opt lst))
(setq x1 (cdr x))
(setq y (member opt (reverse lst)))
(setq y1 (cdr y))
(setq xlst (append (reverse y1) (list des) x1))
(entdel (car ss))
(command "_pline")
(mapcar 'command xlst)
(command)
) ; progn
(alert "\nInvalid selected object")
) ; if
(princ)
)