这里不用把ENAME转化为VLA-OBJ。。。这个问题我已经说过很多遍,好象没有人有什么反应建议你不要就着某个程序或任务来学习LISP,你需要的先把基础部分掌握了- (defun ok_VVV (/ ENAME zxzhs ptcl ptcal cm os PX1 JANG) ;HOLDOSMODE)
- (vl-load-com)
- (setq ENAME (car (entsel "\n拾取天桥路线: ")))
- (setq zxzhs (getpoint "\n点取天桥中心桩号:"))
- (setq ptcl (vlax-curve-getclosestpointto ENAME zxzhs))
- (setq ptCal (vlax-curve-getpointatdist ENAME (+ (vlax-curve-getdistatpoint ENAME ptcl) 20)))
- (setq cm (getvar "cmdecho"))
- (setq os (getvar "osmode"))
- (setvar "cmdecho" 0)
- (setvar "osmode" 0)
- (setq PX1 (vlax-curve-getfirstderiv ENAME (vlax-curve-getparamatpoint ENAME ptCal)))
- (setq JANG (angle '(0 0 0) PX1))
- (command "_.line" (polar ptcal (+ (* pi 0.5) JANG) 10) (polar ptcal (+ (* 1.5 pi) JANG) 10) "");两个10是你需要画线的长度
- (setvar "osmode" os)
- (setvar "cmdecho" cm)
- (princ)
- )
|