乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
楼主: HARRY-PLOTTER

[编程交流] 与点a p最近的顶点

[复制链接]

5

主题

1334

帖子

1410

银币

限制会员

铜币
-20
发表于 2022-7-6 00:43:08 | 显示全部楼层
  1. (defun c:Test ( / s e pr p pt a b ) (vl-load-com)
  2. ;;    Tharwat 2014. cadtutor - mods by M.R.    ;;
  3. (if (and (setq s (entsel)) (wcmatch (cdr (assoc 0 (entget (setq e (car s))))) "*POLYLINE"))
  4.    (progn (setq pr (vlax-curve-getparamatpoint (car s) (setq p (vlax-curve-getclosestpointto (car s) (cadr s)))))
  5.           (setq a (vlax-curve-getpointatparam (car s) (fix pr)))
  6.           (setq b (vlax-curve-getpointatparam (car s) (1+ (fix pr))))
  7.           (entmakex (list '(0 . "POINT") (cons 10 a) '(62 . 3)))
  8.           (entmakex (list '(0 . "POINT") (cons 10 b) '(62 . 3)))
  9.    )
  10.    (princ "\n Nothing selected or not a Polyline <!>")
  11. )
  12. (princ)
  13. )
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-7 14:23 , Processed in 1.458791 second(s), 52 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表