本帖最后由 Gu_xl 于 2012-9-12 16:32 编辑
- ;用法 (putVertex (car(entsel)) (trans (getpoint) 0 1) 1)
- ;; pl = LWPOLYLINE POLYLINE 3DPOLY
- ;; pt = 顶点坐标
- ;; index = 顶点索引
- (defun putVertex (pl pt index)
- (if (= 'ename (type pl))
- (setq pl (vlax-ename->vla-object pl))
- )
- (if (= "AcDbPolyline" (vla-get-ObjectName pl))
- (setq pt (list (car pt) (cadr pt)))
- )
- (VL-CATCH-ALL-APPLY
- 'vla-put-coordinate
- (list
- pl
- index
- (vlax-make-variant
- (vlax-safearray-fill
- (vlax-make-safearray
- vlax-vbdouble
- (cons 0 (1- (length pt)))
- )
- pt
- )
- )
- )
- )
- )
|