+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Forum Newbie
    Using
    AutoCAD 2010
    Join Date
    Jul 2010
    Posts
    8

    Default DIESEL expression - XREF path ONLY

    Registered forum members do not see this ad.

    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

  2. #2
    Super Member irneb's Avatar
    Computer Details
    irneb's Computer Details
    Operating System:
    Win7 Pro 64bit
    Computer:
    Antec One Hundred
    Motherboard:
    ASUS P8P67-Pro P67
    CPU:
    Intel i7 2600 @ 3.4GHz
    RAM:
    16GB-1600MHz
    Graphics:
    GeForce GT 430 (1GB)
    Primary Storage:
    Seagate1TB SATA2 - 7200rpm
    Monitor:
    Samsung 2333TN 23" 1920 x 1080 Full HD LCD Monitor2GW
    Discipline
    Architectural
    irneb's Discipline Details
    Occupation
    Architectural Technician and Programmer
    Discipline
    Architectural
    Using
    AutoCAD 2013
    Join Date
    Sep 2010
    Location
    Jo'burg SA
    Posts
    1,739

    Default

    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?
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  3. #3
    Forum Newbie
    Using
    AutoCAD 2010
    Join Date
    Jul 2010
    Posts
    8

    Default

    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

  4. #4
    Super Member irneb's Avatar
    Computer Details
    irneb's Computer Details
    Operating System:
    Win7 Pro 64bit
    Computer:
    Antec One Hundred
    Motherboard:
    ASUS P8P67-Pro P67
    CPU:
    Intel i7 2600 @ 3.4GHz
    RAM:
    16GB-1600MHz
    Graphics:
    GeForce GT 430 (1GB)
    Primary Storage:
    Seagate1TB SATA2 - 7200rpm
    Monitor:
    Samsung 2333TN 23" 1920 x 1080 Full HD LCD Monitor2GW
    Discipline
    Architectural
    irneb's Discipline Details
    Occupation
    Architectural Technician and Programmer
    Discipline
    Architectural
    Using
    AutoCAD 2013
    Join Date
    Sep 2010
    Location
    Jo'burg SA
    Posts
    1,739

    Default

    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.
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  5. #5
    Forum Newbie
    Using
    AutoCAD 2010
    Join Date
    Jul 2010
    Posts
    8

    Default

    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.

  6. #6
    Super Member irneb's Avatar
    Computer Details
    irneb's Computer Details
    Operating System:
    Win7 Pro 64bit
    Computer:
    Antec One Hundred
    Motherboard:
    ASUS P8P67-Pro P67
    CPU:
    Intel i7 2600 @ 3.4GHz
    RAM:
    16GB-1600MHz
    Graphics:
    GeForce GT 430 (1GB)
    Primary Storage:
    Seagate1TB SATA2 - 7200rpm
    Monitor:
    Samsung 2333TN 23" 1920 x 1080 Full HD LCD Monitor2GW
    Discipline
    Architectural
    irneb's Discipline Details
    Occupation
    Architectural Technician and Programmer
    Discipline
    Architectural
    Using
    AutoCAD 2013
    Join Date
    Sep 2010
    Location
    Jo'burg SA
    Posts
    1,739

    Default

    Registered forum members do not see this ad.

    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/EN...30d6b-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.
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

Similar Threads

  1. Can a Diesel Expression in a field be updated.
    By muck in forum .NET, ObjectARX & VBA
    Replies: 5
    Last Post: 21st Feb 2011, 04:10 pm
  2. xref path
    By mickeyp2814 in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 15th May 2007, 09:31 pm
  3. Field or Diesel expression for view name
    By TuFoFi in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 2nd Mar 2007, 12:36 am
  4. Replies: 5
    Last Post: 28th Mar 2006, 06:23 pm
  5. Xref Path
    By wherestheanykey in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 5th Mar 2006, 09:10 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts