明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 897|回复: 6

[提问] 多段线(折线)上任意一点到起点的距离怎么求?

[复制链接]
发表于 2017-12-30 00:43 | 显示全部楼层 |阅读模式
多段线为折线,其上的一点到起点的距离(不是直线距离),怎么可以快速的求得?

本帖子中包含更多资源

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

x
发表于 2018-1-1 09:54 | 显示全部楼层
(setq ee (entsel) en (car ee) pt (cadr ee))
(vlax-curve-getDistAtPoint en  pt)
 楼主| 发表于 2018-1-1 16:46 | 显示全部楼层
Andyhon 发表于 2018-1-1 09:54
(setq ee (entsel) en (car ee) pt (cadr ee))
(vlax-curve-getDistAtPoint en  pt)

非常感谢, 试了一下,不可以,后来转为vla对象后ok了
发表于 2018-1-1 17:29 | 显示全部楼层
有可能是版本差异

若 pt 点不是落在 Pline 上,
依需求考虑是否补上 Osnap 函数
发表于 2020-3-15 20:32 | 显示全部楼层
Andyhon 发表于 2018-1-1 09:54
(setq ee (entsel) en (car ee) pt (cadr ee))
(vlax-curve-getDistAtPoint en  pt)

反过来,距离端点一定距离的坐标怎么求呢?这个很有用,却没人发布。
发表于 2020-3-16 09:31 | 显示全部楼层
Try
(vlax-curve-getPointAtDist curve-obj dist)

(vlax-curve-getPointAtDist splineObj 55.5)
发表于 2020-4-15 12:02 | 显示全部楼层
Andyhon 发表于 2020-3-16 09:31
Try
(vlax-curve-getPointAtDist curve-obj dist)

非常棒的函数
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-3-29 21:14 , Processed in 0.200384 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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