乐筑天下

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

[编程交流] In a lisp, more routines

[复制链接]

19

主题

59

帖子

40

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
95
发表于 2022-7-5 20:28:51 | 显示全部楼层 |阅读模式
Following the example of post http://www.cadtutor.net/forum/showthread.php?31653-Lisp-coordinates-of-points-to-excel-sheet-(-point-number)&p=258931&viewfull=1#post258931, is it possible to put in one more routine operations to these settings at the beginning:
1. Select a polyline (only LW)
2. Add a point (in current layer) at the intersection of lines or LW polylines with a selected polyline
3. Number the points of intersection (justification of the point of intersection)
3. Export numbered points to .txt file with coma separator N, Y, X, Z (if inserted points)
4. Break intersecting lines or polylines at points of intersection 2.)
5. Break selected polyline 1.)
6. If break selected polyline, convert segments polyline 5.) to lines
7. If convert segments to line, print segment length on the middle lines
212852fy8tcc7w3wyqzojt.jpg
回复

使用道具 举报

5

主题

1334

帖子

1410

银币

限制会员

铜币
-20
发表于 2022-7-5 21:10:11 | 显示全部楼层
Yes, its doable, but unfortunately I don't have much time to play with  this problem... I would do it differently... I would use  (vla-intersectwith) method to obtain all intersections between LWPOLY  and other entities or if all entities are LWPOLYS (I would use  "plintav.lsp" from PLINETOOLS posted  here...  In all situations I would then add vertices of intersections to LWPOLY  with the same algorithm like "plav.lsp" from PLINETOOLS... Then I would  entmake texts numbering vertices of LWPOLY, make list of dotted pairs  (cons pt no), where pt is list representing vertex point of LWPOLY and no  integer for numbering vertex, then I would write this info into CSV file  using (setq f (open "c:/lwvertinfo.csv" "w")) and (write-line) function  then (close f)... Then I would just explode LWPOLY into LINES and also  entmake texts at each line mid point with its length (if its necessary I  would align this texts to line entities using (angle '(0.0 0.0 0.0)  (vlax-curve-getfirstderiv lin 0.0)), and for mid point for text  insertions I would use (mapcar '/ (mapcar '+ (cdr (assoc 10 (entget  lin))) (cdr (assoc 11 (entget lin)))) '(2.0 2.0 2.0)); for length I would just use (distance (cdr (assoc 10 (entget lin))) (cdr (assoc 11 (entget lin))))...
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 21:47:31 | 显示全部楼层
Like you Marko use the pick pline as a "Fence" option to build the list of objects, eg dim house plans I just pick left side and right side and offset all done. Ps no post ncopyrited software.
 
Manually just use snap end,int and use a auto pt num routine then export to excel.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-11 09:24 , Processed in 0.565067 second(s), 61 queries .

© 2020-2025 乐筑天下

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