乐筑天下

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

[编程交流] Extract polyline X,Y,Z,Dwg_Lay

[复制链接]

1

主题

2

帖子

1

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 06:25:34 | 显示全部楼层 |阅读模式
Hi guys,
 
There are a number of forum topics around the internet asking similar questions, each with good answers (e.g. Lee Mac here) but so far I haven't found an answer to my problem.
 
What I would like to do is extract information from several long polylines (each on specific layers) and create a csv text file of the output, saved to the same directory and with the same name as the .dwg file.
 
I need each row of the .csv file to contain the coordinates of one point on a polyline (X,Y,Z) but then additionally include a fourth 'label' column which would be in the format:
 
[DrawingName]_[Layer]
 
DrawingName = name of the .dwg file
Layer = layer the polyline is on
 
Example output:
X,Y,Z,Dwg1_layer1
X,Y,Z,Dwg1_layer1      ;one row for each point on polyline
X,Y,Z,Dwg1_layer1
....
X,Y,Z,Dwg1_layer2      ;this is the next polyline, on 'layer2'
X,Y,Z,Dwg1_layer2
X,Y,Z,Dwg1_layer2
etc
 
The label column is necessary as I need to combine information from many different files and the ability to identify and sort where the data came from is essential.
 
I've attempted to modify existing 'extract XYZ' code that I've found around the internet but it seems to be beyond my current lisp skills .  Any help you guys can give would be simply amazing!
回复

使用道具 举报

7

主题

143

帖子

136

银币

初来乍到

Rank: 1

铜币
36
发表于 2022-7-6 07:05:22 | 显示全部楼层
to point you in the right direction...
the DXF group code for the layer an object is on is: 8
the system varible "dwgname" will get you the file name
回复

使用道具 举报

1

主题

2

帖子

1

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 07:38:20 | 显示全部楼层
Thanks, I'll give it another go when I have some spare time.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 18:22 , Processed in 0.389017 second(s), 58 queries .

© 2020-2025 乐筑天下

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