iforwms Posted August 24, 2011 Share Posted August 24, 2011 Hi, Is there a way of showing only the location of the xrefs using a diesel expression (or otherwise)? At the moment I'm using $(xrefs,5), but all the xrefs are in the same folder, and I only want that folder path shown once. I.e., even if I have 5 xrefs, I just want one line showing the fodler path of those xrefs. Any ideas? Cheers, -Ifor Quote Link to comment Share on other sites More sharing options...
irneb Posted August 25, 2011 Share Posted August 25, 2011 I don't think it's possible using Diesel. If the folder is always the same, you could use the $(strcat,...) to extract only from after the last \ character. Though how to get the position of that last \ is not something I think can be done through Diesel automatically. You'd probably have to use something like Lisp instead ... but then it can't be used inside a field now can it? Quote Link to comment Share on other sites More sharing options...
iforwms Posted August 25, 2011 Author Share Posted August 25, 2011 Thanks for the reply. I've had another idea. Say the xrefs are always in D:\Projects\XXX\XREF and the drawing is always in D:\Projects\XXX\Drawings Is there a way of removing the folder name from the dwgprefix? So dwgprefix plus some command to strip out "Drawings" from the path and append XREF to it instead? Thanks Quote Link to comment Share on other sites More sharing options...
irneb Posted August 25, 2011 Share Posted August 25, 2011 Probably, using strlen and getvar. Just a query though, are you using RText? The $(xrefs,5) gives me an error if it's inside a MText - it just results in $(xrefs)?? Not sure if the Diesel I'm referring to would work in RText though. Quote Link to comment Share on other sites More sharing options...
iforwms Posted August 25, 2011 Author Share Posted August 25, 2011 Yes using RText. I used strlen to remove the folder name, but obviously, if the drawing isn't in a folder called 'drawing', then it just removes 7 characters from the path. I need to remove all characters from the last / to the end of the path. Quote Link to comment Share on other sites More sharing options...
irneb Posted August 25, 2011 Share Posted August 25, 2011 Unfortunately Diesel just don't have a search inside a string. Here are the only functions you can use in Diesel: http://docs.autodesk.com/ACD/2011/ENU/filesACG/WS73099cc142f4875513fb5cd10c4aa30d6b-7b3c.htm In Lisp I'd be able to use the vl-string-search, or even use a loop and wcmatch. But then you can't place a Lisp function call inside a field / RText. BTW, what are you trying to accomplish? It doesn't seem as if you can even use $(substr inside RText. Do you simply want to list all the xrefs contained in the drawing? If so I'd say your best bet is to use a lisp, though it would not necessarily update automatically - it's possible to write it so it does though. Quote Link to comment Share on other sites More sharing options...
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.