乐筑天下

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

[编程交流] 3dpolyline例程

[复制链接]

5

主题

13

帖子

8

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-5 23:13:28 | 显示全部楼层 |阅读模式
我正在寻找3dpolyline维度的lips例程。我希望有人能帮助我。
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-5 23:34:36 | 显示全部楼层
一点信息。
回复

使用道具 举报

5

主题

13

帖子

8

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-5 23:54:43 | 显示全部楼层
我有一条3dpolyline。如何测量直线3dpolyline的长度。
我其实不知道怎么写唇语套路。
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-5 23:59:49 | 显示全部楼层
 
像这样添加了多个选项
 
  1. (if (and (setq s (car (entsel "\n Select [Polyline,SPline,Line,Arc] : ")))
  2.         (wcmatch (cdr (assoc 0 (entget s))) "*POLYLINE,SPLINE,LINE,ARC")
  3.    )
  4. (setq l (vlax-curve-getdistatparam s (fix (vlax-curve-getendparam s))))
  5. )
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 00:22:28 | 显示全部楼层
另一种方法是创建三维点列表,然后根据需要计算出各个长度。
 
  1. (defun getcoords (ent)
  2. (vlax-safearray->list
  3.    (vlax-variant-value
  4.      (vlax-get-property
  5.    (vlax-ename->vla-object ent)
  6.    "Coordinates"
  7.      )
  8.    )
  9. )
  10. )
  11. (defun co-ords2xy ()
  12. ; convert now to a list of xy as co-ords are x y x y x y if 3d x y z x y z
  13. (setq numb (/ (length co-ords) 2))
  14. (setq I 0)
  15. (repeat numb
  16. (setq xy (list (nth (+ I 1) co-ords)(nth I co-ords) ))
  17. (setq coordsxy (cons xy coordsxy))
  18. (setq I (+ I 2))
  19. ) ; end repeat
  20. )
  21. (setq plobjs (ssget (list (cons 0 "*polyline"))))
  22. (setq numb1 (sslength plobjs))
  23. (setq x numb1)
  24. (repeat numb1
  25. (setq obj (ssname plobjs (setq x (- x 1))))
  26. (setq co-ords (getcoords obj))
  27. )
  28. (co-ords2xy)
  29. (setq inc (length coordsxy))
  30. (repeat (/ inc  2)
  31. (setq x (rtos (nth (setq inc (- inc 1)) co-ords) 2 3 ))
  32. (setq y (rtos (nth (setq inc (- inc 1)) co-ords) 2 3 ))  
  33. (setq xy (strcat x "," y ))
  34. (princ xy)
  35. (princ "\n ")
  36. )
  37. (setq ent nil) (setq obj nil)(setq plobjs nil)
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-11 00:08 , Processed in 0.458498 second(s), 62 queries .

© 2020-2025 乐筑天下

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