乐筑天下

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

[编程交流] 沿po分布顶点

[复制链接]
pBe

32

主题

2722

帖子

2666

银币

后起之秀

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

铜币
211
发表于 2022-7-5 19:28:48 | 显示全部楼层
samifox,在检查了你的代码后,我认为你应该改变
 
  1. (Defun c:demo ()   (if (and (setq pline (car (entsel "\nSelect Polyline:")))            (eq (cdr (assoc 0 (entget pline))) "LWPOLYLINE")            (setq int (getdist "\nEnter Interval:"))            (setq in int)       )     [color=red][b](while (Setq pt (vlax-curve-getPointAtDist pline int))       (setq ppt (vlax-curve-getparamatpoint pline pt))       (vlax-invoke         (vlax-ename->vla-object pline)         'AddVertex         (1+ (fix ppt))         (list (car pt) (Cadr pt))       )       (setq int (+ int in))     )[/b][/color]   ) )

 

 
  1. (setq in segcnt)

 
之后,您应该再次测试代码。。。
 
M、 R。
回复

使用道具 举报

218

主题

699

帖子

483

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1090
发表于 2022-7-5 19:31:57 | 显示全部楼层
马里奥。。。你知道你是我的国王吗!!!
 
感谢您通读所有帖子
 
你让我开心
 
上帝保佑你
谢伊
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

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

铜币
211
发表于 2022-7-5 19:35:43 | 显示全部楼层
回复

使用道具 举报

218

主题

699

帖子

483

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1090
发表于 2022-7-5 19:37:52 | 显示全部楼层
sorry i was thinking i need the code.
 
i post it
 
thanks
shay
m.dwg
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

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

铜币
211
发表于 2022-7-5 19:42:06 | 显示全部楼层
Sorry dude, still don't get it.  
 
Try this link. 7-10] http://www.cadtutor.net/forum/showthread.php?78119-Intersection-of-a-vertical-lines-and-a-polyline. Me think that's what you're after.
 
Cheers
回复

使用道具 举报

6

主题

122

帖子

118

银币

初来乍到

Rank: 1

铜币
30
发表于 2022-7-5 19:45:27 | 显示全部楼层
The code works great PBE
I don't have an immediate use for it but it does work just fine when I tested it
Thanks
~Greg
回复

使用道具 举报

218

主题

699

帖子

483

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1090
发表于 2022-7-5 19:46:46 | 显示全部楼层
you can  see those points? they supposed to be destitute exactly like the lines.
195508rn042lgnrlpwpwhn.jpg
回复

使用道具 举报

218

主题

699

帖子

483

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1090
发表于 2022-7-5 19:50:33 | 显示全部楼层
  1. (Defun c:demo ()   (if (and (setq pline (car (entsel "\nSelect Polyline:")))            (eq (cdr (assoc 0 (entget pline))) "LWPOLYLINE")            (setq int (getdist "\nEnter Interval:"))            (setq in int)       )     [color=red][b](while (Setq pt (vlax-curve-getPointAtDist pline int))       (setq ppt (vlax-curve-getparamatpoint pline pt))       (vlax-invoke         (vlax-ename->vla-object pline)         'AddVertex         (1+ (fix ppt))         (list (car pt) (Cadr pt))       )       (setq int (+ int in))     )[/b][/color]   ) )
 
thanks for your timr dude
 
here the lines i dont understand (RED)
 
 


  • after getting the poly id and interval info you assign in to int why?
  • (than the while loops until nill)
  • pt get the first point according to the interval
  • ppt than get the distance up to this point
  • than you invoke conversion and the call AddVertex
  • than you advance ppt by 1 , why?
  • than you make a list of the entity, why?

(its open to everyone:) )
 
Thanks
Shay
回复

使用道具 举报

5

主题

1334

帖子

1410

银币

限制会员

铜币
-20
发表于 2022-7-5 19:54:48 | 显示全部楼层
samifox, after examining your code, me think you should change
 
  1. (setq in segcnt)
 
to
 
  1. (setq in seglen)
 
After, you should test your code again...
 
M.R.
回复

使用道具 举报

218

主题

699

帖子

483

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1090
发表于 2022-7-5 19:57:27 | 显示全部楼层
Mario...do you know you are my king!!!
 
Thank for reading thru all the thread
 
You make my day
 
God bless you
shay
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-12 13:54 , Processed in 0.683401 second(s), 72 queries .

© 2020-2025 乐筑天下

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