马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
[sell=3] - (defun c:XDTB_POLYArea ( / a d dynpt e e1 ge lastpnt x)
- (defun _callback(dynpt)
- (xdrx_entity_move e1 lastpnt dynpt)
- (setq lastpnt dynpt)
- )
- (if (setq e (car (xdrx_entsel "\n拾取封闭的曲线<退出>:" '((0 . "*POLYLINE,CIRCLE,SPLINE,ELLIPSE")))))
- (progn
- (xdrx_begin)
- (xdrx_initget "P G M")
- (initget "P G M")
- (if (not (setq ge (getkword "\n单位格式[平方米(P)/公顷(G)/亩(M)]<亩>:")))
- (setq ge "M")
- )
- (setq a (car (xdrx_getarea e)))
- (cond
- ((= ge "M")
- (setq a (/ a 666.666667) d "亩")
- )
- ((= ge "P")
- (setq d "平")
- )
- ((= ge "G")
- (setq a (/ a 10000.0) d "公顷")
- )
- )
- (setq e1 (xdrx_text_make '(0 0) (xdrx_prompt (rtos a 2 1) d t) 3.5 0.0))
- (setq lastpnt '(0 0 0))
- (xdrx_pointmonitor "_CALLBACK")
- (if (not (getpoint "\n标注位置<中心>:"))
- (progn
- (setq x (xd::geom:get9pt e 5))
- (xdrx_entity_move e1 (xd::geom:get9pt e1 5) x)
- )
- )
- (xdrx_pointmonitor)
- (xdrx_end)
- )
- )
- (princ)
- )
[/sell] |