• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    AutoCAD 2004/2005/2006 DWG Format

    Reply
    Distinguished Contributor
    Posts: 676
    Registered: ‎07-19-2005

    A part of filename field

    354 Views, 12 Replies
    05-07-2006 01:36 AM
    Can i use a field that will get only the last syllable of the filename?
    Thanks.
    Please use plain text.
    *Dean Saadallah

    Re: A part of filename field

    05-07-2006 01:01 PM in reply to: scgham
    what's the last part of the filename? Something consistent
    and identifiable, or is it a moving target?

    --
    Dean Saadallah
    Add-on products for LT
    http://www.pendean.com/lt
    --
    Please use plain text.
    Distinguished Contributor
    Posts: 676
    Registered: ‎07-19-2005

    Re: A part of filename field

    05-07-2006 11:19 PM in reply to: scgham
    No it's a moving target, the first part is the one which is constant and that's why we want to eleminate it in the title block, the file name is something like that:
    AAAAA-BCDDEE (with the exact no. of characters)
    where the 5As refer to the project no. which is of course constant for all dwgs in that project, and that's the part we want to eleminate.
    Please use plain text.
    Distinguished Contributor
    Posts: 676
    Registered: ‎07-19-2005

    Re: A part of filename field

    05-09-2006 11:45 PM in reply to: scgham
    anyone has the answer?
    i believe it's possible, may be some diesel expert can help.
    Please use plain text.
    Distinguished Contributor
    Posts: 613
    Registered: ‎05-15-2004

    Re: A part of filename field

    05-10-2006 04:22 AM in reply to: scgham
    Hi,

    May be possible, if you use RTEXT instead of Fields. Use following DIESEL Expressions to get the system variables:

    1) $(getvar,dwgprefix)
    2) $(getvar,dwgname)

    Truncate the required characters from the above using DIESEL language.

    Regards,
    Pradeep Hebbar
    Please use plain text.
    Distinguished Contributor
    Posts: 676
    Registered: ‎07-19-2005

    Re: A part of filename field

    05-10-2006 04:39 AM in reply to: scgham
    I said i need a diesel expert to help me, not to tell me use diesel language, i know nothing about this language.
    anyway thanks a lot for telling me its possible.
    Also, couldn't diesel expressions be passed inside fields?
    Please use plain text.
    Distinguished Contributor
    Posts: 613
    Registered: ‎05-15-2004

    Re: A part of filename field

    05-10-2006 04:42 AM in reply to: scgham
    Hi,

    I hope this is the exact DIESEL Expression to suit your requirement.
    Copy & paste the following expression in RTEXT.

    $(substr,$(getvar,dwgname),6,$(strlen,$(getvar,dwgname)))

    Note that I have used 6, as the 5 first characters to be truncated. (You wanted to remove initial 5A's)

    Regards,
    Pradeep Hebbar
    Please use plain text.
    Distinguished Contributor
    Posts: 676
    Registered: ‎07-19-2005

    Re: A part of filename field

    05-10-2006 05:02 AM in reply to: scgham
    That's awesome.
    Thanks a lot.
    Please use plain text.
    Distinguished Contributor
    Posts: 676
    Registered: ‎07-19-2005

    Re: A part of filename field

    05-11-2006 02:37 AM in reply to: scgham
    Now, i found one more problem, not the dwgname have ".dwg" at the end, can i eleminate the last 4 characters as well?
    Thanks in advance.
    Please use plain text.
    Distinguished Contributor
    Posts: 613
    Registered: ‎05-15-2004

    Re: A part of filename field

    05-11-2006 05:50 AM in reply to: scgham
    Hi,

    Here is a try.

    $(substr,$(getvar,dwgname),6,$(-,$(strlen,$(getvar,dwgname)) ,9))

    5+4=9 characters are stripped off from the Filename.

    Make sure that the above 2 statements appear in single line inside Field/ RTEXT.

    Regards,
    Pradeep Hebbar
    Please use plain text.