明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1153|回复: 3

请问怎么得到尺寸线的角度

[复制链接]
发表于 2008-9-26 10:42 | 显示全部楼层 |阅读模式
请问怎么得到尺寸线的角度,谢谢
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2008-9-26 11:01 | 显示全部楼层

;; ▓ (lt:dim-definingPoint edata)
;; [功能] 获取标注的定义点
;; [参数] edata---标注对象的 DXF 定义数据
;; [返回] 包含两个点的表,依次为 (第一个尺寸线定义点 第二个尺寸线定义点)
(defun lt:dim-definingPoint (edata / dxf typ p10 p13 p14 ang)
  (setq dxf (lambda (x) (cdr (assoc x edata)))
        typ (- (dxf 70) 32)
        p10 (dxf 10)
        p13 (dxf 13)
  )
  (list (cond
          ((zerop typ)
           (setq ang (dxf 50) p13 (list (car p13) (cadr p13) (last p10)))
           (inters p10 (polar p10 ang 1) p13 (polar p13 (+ ang (/ pi 2)) 1) nil)
          )
          ((= typ 1)
           (setq p14 (dxf 14) ang (if (equal p14 p13 1e-7) 0 (angle p14 p13)))
           (if (equal p10 p14 1e-7)
             p13
             (polar p10 ang (dxf 42))
           )
          )
        )
        p10
  )
)

用法:根据两个定义点求出角度

(apply 'angle (lt:dim-definingPoint (entget (car(entsel)))))

 楼主| 发表于 2008-9-26 11:10 | 显示全部楼层
万分感谢我试试
发表于 2008-11-12 02:35 | 显示全部楼层

大侠,能否告诉我如何得到尺寸线的位置,或尺寸线离标注点的距离,谢谢

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-4 11:23 , Processed in 0.510949 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表