明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1068|回复: 1

帮我找找毛病,头都大了

[复制链接]
发表于 2005-12-1 16:25 | 显示全部楼层 |阅读模式
,这个程序主要是要把一个闭合的pline线关键点的坐标都标出来,可怎么也执行不了,高手帮忙看看

本帖子中包含更多资源

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

x
发表于 2005-12-1 16:35 | 显示全部楼层

(defun c:tt ()
  (vl-load-com)
  (setq obj (car (entsel "\nSelect a Polyline: ")))
  (MASSOC 10 (entget obj))
)
(defun massoc (key alist / nlist tmp)

  (foreach x alist
    (if (eq key (car x))
      (setq nlist (cons (cdr x) nlist))
    )
  )

  (setq num (length nlist))
  (setq tmp 0)
  (repeat num
    (zz (nth tmp nlist))
    (setq tmp (+ 1 tmp))
  )
)

(defun zz (p1 / x y)
  (setq
    x (strcat "X-" (rtos (nth 0 p1) 2 3))
    y (strcat "Y-" (rtos (nth 1 p1) 2 3))
  )
  (command "line" p1 (polar p1 0 30) "")
  (command "text" "j" "bl" p1 2.5 0 x)
  (command "text" "j" "tl" (polar p1 85 -2) 2.5 0 y)
)

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

本版积分规则

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

GMT+8, 2024-5-3 08:41 , Processed in 0.359462 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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