乐筑天下

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

[编程交流] c# - Transform absolute XREF l

[复制链接]

5

主题

14

帖子

9

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-6 22:03:31 | 显示全部楼层 |阅读模式
I try to do a very simple thing : transform the absolute XREF links in relative in C#.
 
I have no idea how can I translate the XREF path in relative.
 
I don't know where I can start.
 
I saw this article but does'nt help me ! Have you got information or details how can I do that?
 
Thanks a lot,
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 22:29:48 | 显示全部楼层
Stephen's DevBlog article has everything you need, with exception of the assumed drawing, and XREF locations (you'll have to do that per your project folder structure, etc.).
 
Cheers
回复

使用道具 举报

5

主题

14

帖子

9

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-6 22:41:52 | 显示全部楼层
Ok,
 
So, I will do my homework.
 
Thanks
回复

使用道具 举报

5

主题

14

帖子

9

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-6 23:03:11 | 显示全部楼层
Hi,
 
I see more the code.
 
Stephen DevBlog uses the case where you know the current path of your XREF and the current path of your files. I don't want to rely to FindFile to find my XREF, on very big project, it's impossible.
 
The fonction must deduce (that's the main point) what is the relative path.
 
Do you understand my horrible English?
 
Best regards
 
In my idea, I would like to have a generic case.
 
I launch the command, the script must knows where I am and how can I make a relative path to all my XREF.
 
The main problem is to find a solution to {oldpathabsolute} {newpathrelative} without external intervention.
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 23:07:20 | 显示全部楼层
 
Consider using System.IO to 'find' the relative path, by removing the folders common to both the drawing you're evaluating via side-Database, and your BlockTableRecord's PathName, concatenating the resultant string as needed (i.e., "..\" + "SomePath").
 
Cheers
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-4 09:10 , Processed in 0.331180 second(s), 62 queries .

© 2020-2025 乐筑天下

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