在本部分代码中
(while(setq pntx(getpoint“\n从左到右选择点:”))
(setq pnt(cons pntx pnt))
)
(setq fpnt(最后一个pnt))
(setq fdistbp(sqrt(+(expt(-car bp)(car fpnt))2)(expt(-cadr bp)(cadr fpnt))2)))
(princ“\n选择H=”上的插入点)
(princ(浮动顶部))
(setq inspt(getpoint))
(entmake'(
(0.“多段线”);对象类型
(66 . 1)))
(setq n 0)
(setq pnt(反向pnt))
(重复(长度pnt)
(设置(第n个pnt))
(setq y(car ent))
(setq x(cadr ent))
(setq z(caddr ent))
(setq fdistpnt(sqrt(+(expt(-car fpnt)y)2)(expt(-cadr fpnt)x)2)))
(setq hdist(sqrt(+(expt(-car bp)y)2)(expt(-cadr bp)x)2));računa udaljenost od točke profila do bp
(setq vdist(-(caddr bp)z))
(如果(
(setq ypt(+(car inspt)hdist))
(setq ypt(-car inspt)hdist)
)
(setq xpt(-(+(cadr inspt)差)vdist))
(setq vpt(列表ypt xpt 0.000))
(entmake(列表
'(0.“顶点”);对象类型
(cons 10 vpt)))
(如果(或(=表“y”)(=表“y”))
(程序
(setq xtext(-xpt(-z(-chartlow(-行0.5 1070;)Ю)))
(setq textpos(list ypt xtext 0.000))
(命令“text”“j”“bc”textpos“90”(rtos z 2 3))
;(grdraw(list ypt(-xtext 0.5))(list ypt(+xtext 0.5))2)
(普林斯)
)
)
;(setq计数(1+计数))
(如果(>fdistbp fdistpnt)
(setq hdist(*hdist-1)))
(setq ftextdist(strcat ftextdist(rtos hdist 2 3)“\t”))
(setq ftextv(strcat ftextv(rtos z 2 3)“\t”))
)
(entmake’((0。“sequend”)) 阅读代码发布指南
使用Vlide运行代码,然后使用inspect或break-on-error查找其停止的位置,调试break-on-error,然后是最后一个中断源
页:
1
[2]