乐筑天下

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

[编程交流] Break & Lengthen routine help.

[复制链接]

22

主题

55

帖子

33

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
110
发表于 2022-7-6 06:38:39 | 显示全部楼层 |阅读模式
I want use the Break command to split a line into (2) two separate lines. How do I create a selection set of those (2) two lines. My end goal is to Lengthen the ends of those (2) two lines by 24". . . but towards the point where the Break command was picked (I.E. middle of the original line). I just need help creating the code to process the (2) two new lines. Here's what I have so far. It seems to work on the first line in the list, but crashing on the 2nd line.
 
  1. (defun C:test(/ ent ldist)(setq CNT 0)(setq ldist 24.0)(prompt "\nPick rafters to lengthen...")    (setq ent (ssget))  (if (not (null ent)) (progn   (setq LEN (sslength ent))   (repeat LEN       (setq ent1 (ssname ent CNT))       (command "_.lengthen" "_de" ldist ent1)       (setq CNT (1+ CNT))   );end repeat);end progn);end if);end defun
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

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

铜币
438
发表于 2022-7-6 07:03:18 | 显示全部楼层
1. Would you only be selecting lines?
2. Would the break point always be the midpoint?
3. From the original midpoint, you want to add 24" to the two newly created lines?
回复

使用道具 举报

22

主题

55

帖子

33

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
110
发表于 2022-7-6 07:34:36 | 显示全部楼层
Good morning Alanjt,
Yes, always selecting lines. I know how to filter for only lines...
 
  1. (setq ent (ssget '((0 . "LINE"))))
The Break point is a user selected point along the line.
Yes, I want to Lengthen both lines towards the Break point selected.
 
Is the Lengthen command making it too complicated?
Should I just find the end points of each line and move it 24"?
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

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

铜币
438
发表于 2022-7-6 07:38:59 | 显示全部楼层
 
Not at all. I just wanted to get a better understanding of what you were wanting. I ask about the midpoint because you don't give the user an option to select a point along the line. So should they be prompted or will it always be the midpoint? If the user is prompted for the break point, then you can only do this one line at a time, but if the breaking point is always the midpoint, then you can select as many lines as you like.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 15:27 , Processed in 0.812590 second(s), 60 queries .

© 2020-2025 乐筑天下

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