There's a vertex remover example on my Freebies page. Hope it helps.
--
John Uhden, Cadlantic/formerly CADvantage
http://www.cadlantic.com
Sea Girt, NJ
"Mark Dubbelaar" wrote in message
news:6FFD3A8291E473AEF4BB63E9B34B0629@in.WebX.maYIadrTaRb...
> hi
>
> i'm having a bit of trouble with the following routine... it removes a
> vertex from a polyline. the problem is that it doesn't work the first time
> its run, but works everytime after that.... any help would be great
>
> cheers
>
> mark
>
>
>
> (defun C:RV (/ *CURR_OSNAP olderror
> SelectedEntity PolyProperties iCount
> iCount2 NewPoly
> )
>
> ;
> ;;; does not change the vertex on the first run through
> ;
>
> (setq *CURR_OSNAP (getvar "osmode"))
> (setq olderror *error*)
> (setq *error* RVLispError)
>
> (setvar "cmdecho" 0)
> (command "undo" "begin")
> (setvar "osmode" 0)
>
> (setq SelectedEntity (car (entsel "\nSpecify polyline: ")))
>
> (if (and (/= SelectedEntity nil)
> (= (cdr (assoc 0 (entget SelectedEntity))) "LWPOLYLINE")
> )
> (progn
> (setq PolyProperties (entget SelectedEntity))
>
> (initget 1)
> (setvar "osmode" 32)
> (setq SelectedVertex (getpoint "\nSpecify vertex to remove: "))
>
> (setq iCount 0)
> (while (< iCount (cdr (assoc 90 PolyProperties)))
> (setq VertexPosition
> (cdr (nth (+ (* iCount 4) 14) PolyProperties))
> )
>
> (if (and (= (car VertexPosition) (car SelectedVertex))
> (= (cadr VertexPosition) (cadr SelectedVertex))
> )
> (progn
> (setq iCount2 0)
> (while (< iCount2 4)
>
> (setq NewPoly
> (vL-remove (nth (+ (* iCount 4) 14) PolyProperties)
> PolyProperties
> )
> )
> (setq iCount2 (1+ iCount2))
> ) ;while
>
> (setq
> NewPoly (subst
> (cons
> 90
> (1- (cdr (assoc 90 PolyProperties)))
> )
> (assoc 90 PolyProperties)
> NewPoly
> )
> )
> (entmod NewPoly)
> (entupd (cdr (assoc -1 NewPoly)))
>
> (setq iCount (cdr (assoc 90 PolyProperties)))
> ) ;progn
> ) ;if
> (setq iCount (1+ iCount))
> ) ;while
> ) ;progn
>
> (prompt "\nNo polylines selected!")
> ) ;if
>
> (RVCleanUp)
>
> (princ)
> )
>
> (princ)
>
>