AutoCAD 2004/2005/2006

Reply
Distinguished Contributor
scgham
Posts: 676
Registered: ‎07-19-2005
Message 1 of 13 (1,139 Views)

A part of filename field

1139 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.
*Dean Saadallah
Message 2 of 13 (1,139 Views)

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
--
Distinguished Contributor
scgham
Posts: 676
Registered: ‎07-19-2005
Message 3 of 13 (1,139 Views)

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.
Distinguished Contributor
scgham
Posts: 676
Registered: ‎07-19-2005
Message 4 of 13 (1,139 Views)

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.
Distinguished Contributor
pradeep_hebbar
Posts: 613
Registered: ‎05-15-2004
Message 5 of 13 (1,139 Views)

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
Distinguished Contributor
scgham
Posts: 676
Registered: ‎07-19-2005
Message 6 of 13 (1,139 Views)

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?
Distinguished Contributor
pradeep_hebbar
Posts: 613
Registered: ‎05-15-2004
Message 7 of 13 (1,139 Views)

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
Distinguished Contributor
scgham
Posts: 676
Registered: ‎07-19-2005
Message 8 of 13 (1,139 Views)

Re: A part of filename field

05-10-2006 05:02 AM in reply to: scgham
That's awesome.
Thanks a lot.
Distinguished Contributor
scgham
Posts: 676
Registered: ‎07-19-2005
Message 9 of 13 (1,139 Views)

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.
Distinguished Contributor
pradeep_hebbar
Posts: 613
Registered: ‎05-15-2004
Message 10 of 13 (1,139 Views)

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
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.