明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1594|回复: 2

申请:框选line1、line2,产生两条红色的三等分线

[复制链接]
发表于 2011-5-23 00:48:49 | 显示全部楼层 |阅读模式
1明经币
本帖最后由 yunfengning 于 2011-5-23 00:53 编辑

框选line1、line2两条line线,产生两条红色的三等分线。

附件: 您需要 登录 才可以下载或查看,没有账号?注册

最佳答案

查看完整内容

;;; for test only (defun c:Test () (cond ((null (setq ss (ssget '((0 . "LINE")))))) (T (setq ee1 (ssname ss 0) ee2 (ssname ss 1) pa (cdr (assoc 10 (entget ee1))) pb (cdr (assoc 11 (entget ee1))) pc (cdr (assoc 10 (entget ee2))) pd (cdr (assoc 11 (entget ee2))) px (inters pa pb pc pd T) ) ( ...
发表于 2011-5-23 00:48:50 | 显示全部楼层
;;; for test only
(defun c:Test ()
   (cond
    ((null (setq ss (ssget '((0 . "LINE"))))))
    (T
     (setq ee1 (ssname ss 0)
           ee2 (ssname ss 1)
            pa (cdr (assoc 10 (entget ee1)))
            pb (cdr (assoc 11 (entget ee1)))
            pc (cdr (assoc 10 (entget ee2)))
            pd (cdr (assoc 11 (entget ee2)))
            px (inters pa pb pc pd T)
     )
     (if px
       (setq px pc pc pd pd px)
     )
     (setq dd1 (/ (distance pa pc) 3)
           dd2 (/ (distance pb pd) 3)
           vv1 (angle pa pc)
           vv2 (angle pb pd)
            pe (polar pa vv1 dd1)
            pf (polar pb vv2 dd2)
            pg (polar pe vv1 dd1)
            ph (polar pf vv2 dd2)
     )
     (command "Line" "none" pe "none" pf "")
     (command "Line" "none" pg "none" ph "")
   ))
   (princ)
)
回复

使用道具 举报

 楼主| 发表于 2011-5-23 09:29:13 | 显示全部楼层
程序可用,多谢Andyhon。另可以帮忙整一个类似程序吗?将两条不平行线按角度三等分。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-27 16:13 , Processed in 0.164044 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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