明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1247|回复: 2

求多义线上顺逆转的第N点

[复制链接]
发表于 2009-6-24 18:11:00 | 显示全部楼层 |阅读模式
求多义线上以PT点为起点顺时针和逆时针转的第N点,如图所示,例如求第2点,即点2和点4为所求

本帖子中包含更多资源

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

x
发表于 2009-6-24 20:55:00 | 显示全部楼层
  1. (defun getPt(ent n / lstPoints)
  2.   ;提取所有顶点坐标
  3.   (mapcar '(lambda(x) (if (= (car x) 10) (setq lstPoints (append lstPoints (list (cdr x)))))) (entget ent))
  4.   (if (and (> n 0)(< n (length lstPoints)))
  5.    
  6.     (list
  7.       ;第n个顶点
  8.       (nth (- n 1) lstPoints)
  9.       
  10.       ;倒数第n个
  11.       (nth (- (length lstPoints) n) lstPoints)
  12.       )
  13.     (alert "超出多段线的顶点数!")
  14.     )
  15.   )
 楼主| 发表于 2009-6-25 12:17:00 | 显示全部楼层

thank you

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

本版积分规则

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

GMT+8, 2024-10-1 05:30 , Processed in 0.179273 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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