Jump to content

DIESEL expression - XREF path ONLY


iforwms

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...