CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.096.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator and the updated Barcode generator. New AutoCAD 2026 commands and variables.
Plex.Earth connects AutoCAD and Google Earth
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedField Expression in file name counting from the en

 Post Reply Post Reply
Author
LGDB View Drop Down
Newbie
Newbie


Joined: 02.Nov.2011
Location: Australia
Using: AutoCAD2010, Inventor2011
Status: Offline
Points: 2
Direct Link To This Post Topic: Field Expression in file name counting from the en
    Posted: 06.Jan.2012 at 00:14
Hello all. Happy 2012! Tongue
 
I'm looking for a 'field expression' to get just part of the file name. I found something here: 'CAD tip # 7003'
 
I made some tests using the examples given. All work fine, but what I need is that the expression to count from the end to the beggining of the file name, as they have different number of characters. 
Eg:
The end of the files name are like this: "....... (01).dwg". I'd like to get just the '01'.
 
Two reasons I'd like to build it that way: 
1) This field expression would be part of the sheet set, so all drawing will have the same expression in title block.
2) The file names may change time to time, but the last bit: (01).dwg. 
 
Any ideas? Big%20smile
 
Thank you very much!


Edited by LGDB - 06.Jan.2012 at 00:38
Back to Top
LGDB View Drop Down
Newbie
Newbie


Joined: 02.Nov.2011
Location: Australia
Using: AutoCAD2010, Inventor2011
Status: Offline
Points: 2
Direct Link To This Post Posted: 12.Jan.2012 at 07:54

For now I'm using this expression:

$(substr,$(getvar,DWGNAME),3,$(-,$(strlen,$(getvar,DWGNAME)),9))

Sorry I understanding absolutely nothing about this issue, but I think it works like this, please correct me if I am wrong:

Suppose my file name is 'abcdef.ghi'
1) It picks the 3o. character (letter 'c') of the file name,
2) It starting counting from the end to the beginning starting on 3 (equals letter 'i') up to 9 and trims on letter 'd', leaving just the letter 'c', which it is what I'm looking for.

Is that right?
 
I'd like to find a way to trim after the letter 'c', using the example above, as the file names change the number of characters. If that thought is possible, I wouldn't have to change the last number for each drawing, which defeats the purpose of being something dynamic.

Does anyone know if this is possible?

Thank you!

Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,055 seconds.