乐筑天下

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

[编程交流] vlax曲线函数解释

[复制链接]

218

主题

699

帖子

483

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1090
发表于 2022-7-5 23:51:38 | 显示全部楼层 |阅读模式
你好
 
试图找出vlax曲线函数的工作原理,
在本例中
 
  1. (defun C:TEST (/ int pl pt)
  2. (setq pl (car (entsel "\nSelect pline entity\n")))
  3. (setq pt (vlax-curve-getPointAtDist pl 200))
  4.    (vlax-ename->vla-object pl)
  5.    (vlax-curve-getparamatpoint pl
  6.      (vlax-curve-getclosestpointto pl pt))
  7.       
  8. )

 
-在200个距离单位处获取坐标A
-得到???
-得到???
 
很抱歉我不明白
 
请帮忙?
回复

使用道具 举报

5

主题

1334

帖子

1410

银币

限制会员

铜币
-20
发表于 2022-7-6 00:35:38 | 显示全部楼层
  1. (defun C:TEST ( / pl pt par )
  2. (princ (setq pl (car (entsel "\nSelect pline entity")))) ;; picking curve 'ename (pline belongs to curve family entities)
  3. (princ (setq pt (vlax-curve-getPointAtDist pl 200))) ;; calculating point at dist 200 from start point of curve if curve is larger than 200 units, or calculating end point if curve is smaller than 200 units
  4. ;;  (vlax-ename->vla-object pl)  ;; - unnecessary line (vlax-curve-xxx) functions work with both 'ename and 'vla-object, but it's better to use 'ename because it's faster approach and with less typing
  5. (princ (setq par (vlax-curve-getparamatpoint pl (vlax-curve-getclosestpointto pl pt)))) ;; calculating parameter value of point pt on curve and if point lies on curve it should be somewhere in between (vlax-curve-getstartparam pl) and (vlax-curve-getendparam pl) and if pt is previously calculated to be exactly end point of curve - curve is smaller than 200 units => par= (vlax-curve-getendparam pl)
  6. (princ)
  7. )
回复

使用道具 举报

218

主题

699

帖子

483

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1090
发表于 2022-7-6 00:57:09 | 显示全部楼层
为什么帮助将坐标称为点,将顶点称为参数?
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 21:26 , Processed in 0.428258 second(s), 58 queries .

© 2020-2025 乐筑天下

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