pouicpouic Posted January 15, 2015 Posted January 15, 2015 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, Quote
BlackBox Posted January 15, 2015 Posted January 15, 2015 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 Quote
pouicpouic Posted January 15, 2015 Author Posted January 15, 2015 Ok, So, I will do my homework. Thanks Quote
pouicpouic Posted January 15, 2015 Author Posted January 15, 2015 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. Quote
BlackBox Posted January 15, 2015 Posted January 15, 2015 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. 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.