我还有梦想 发表于 2015-11-27 16:14:53

头疼+++++++

在封闭的面域中(或质心点)生成面域的面积(亩)并显示,例如:1.23亩。我有一段别人的源码,只能每一个面域点击才能生成(调用CAD的boundary命令),能否实现批量生成和标注呢?

dingtiedt 发表于 2015-11-27 17:13:36

本帖最后由 dingtiedt 于 2015-11-27 17:16 编辑

要批量,就不是点选,而是用“框选”。论坛里有的。

http://bbs.mjtd.com/thread-95135-2-1.html

我还有梦想 发表于 2015-11-27 18:33:36

dingtiedt 发表于 2015-11-27 17:13 static/image/common/back.gif
要批量,就不是点选,而是用“框选”。论坛里有的。

http://bbs.mjtd.com/thread-95135-2-1.html

你好,我这个目的不是导出来。显示在面域即可。还是很感谢。

Gu_xl 发表于 2015-11-27 20:25:11

需加载XLRX_API使用:
(defun c:tt (/ ss a pt)
(if (setq ss (ssget (list '(0 . "*polyline")      '(-4 . "<or")
                            '(70 . 1)                '(70 . 129)
                            '(-4 . "or>")
                           )
               )
      )
    (progn
      (foreach e (XLRX-PickSet->List ss)
      (setq
          a (strcat (rtos (/ (* (xlrx-curve-getarea e) 3) 2000) 2 2)
                  "亩"
            )
      )
      (setq
          en (xlrx-make "text" (setq pt (XLRX-GetInnerPoint e)) a 2.0)
      )
      (xlrx-set en "HorizontalMode" 1)
      (xlrx-set en "VerticalMode" 2)
      (xlrx-set en "AlignmentPoint" pt)
      )
    )
)
(princ)
)

我还有梦想 发表于 2015-11-27 20:33:03

Gu_xl 发表于 2015-11-27 20:25 static/image/common/back.gif
需加载XLRX_API使用:

谢谢G版主,用你的代码已解决问题,感谢。
页: [1]
查看完整版本: 头疼+++++++