乐筑天下

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

[编程交流] Select pline, get lenght, then

[复制链接]

3

主题

14

帖子

11

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-5 16:18:25 | 显示全部楼层 |阅读模式
Hi,
 
I want to select one pline, obtain the lenght then use this dimension to offset other pline.
 
Cheers,
 
Gonçalo
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

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

铜币
438
发表于 2022-7-5 16:27:44 | 显示全部楼层
  1. (vlax-curve-getDistAtParam ent (vlax-curve-getEndParam ent))
The above code will return the total length of a line/curve/pline.
From there, you just plug in the value to the Offset command and go.
回复

使用道具 举报

0

主题

19

帖子

21

银币

限制会员

铜币
-2
发表于 2022-7-5 16:37:44 | 显示全部楼层
Find the length of the object can be so:
  1. (vla-get-length (vlax-ename->vla-object ent))
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 16:50:50 | 显示全部楼层
My normal one
 
  1. (vla-get-length (vlax-ename->vla-object (car (entsel "pick object" ))))
回复

使用道具 举报

3

主题

14

帖子

11

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-5 16:54:12 | 显示全部楼层
 
Many thanks. It's perferct!!!
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

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

铜币
358
发表于 2022-7-5 17:06:01 | 显示全部楼层
 
Not yet so.
Try to select any object that doesn't have any length property or just pin a point on the screen to find out the outcome of the codes.
 
Furthermore its not necessarily / recommended at all to convert any object to vla-object unless you are in need of that conversion and have no solution with AutoLISP vanilla ( DXF ).
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 17:12:28 | 显示全部楼层
Tharwat you are correct sometimes you need to pick an object then check what it is and is that property then available and I think it was to do with this exact request for length. It was just a simple example where it was expected the user would pick a suitable object.
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

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

铜币
358
发表于 2022-7-5 17:24:38 | 显示全部楼层
 
Agreed, but I just wanted to pay OP's attention to such important issues.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-7-2 14:57 , Processed in 0.759799 second(s), 68 queries .

© 2020-2025 乐筑天下

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