6 first characters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
6 first characters
Hello,
I use this text in a drawing: &dwg_name
allowing to display the name of my file.
If the name of my file is 126557-Rev2,
is there a way to display only the 6 first characters? (126557)
thanks,
Laurent
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
- Labels:
-
2D Drawing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Laurent,
I think it is not possible in Drawing mode.
dwg_name is system parameter for drawings and in Drawing mode it is not possible to define relations.
If model name = drawing name then you can define a parameter and relation in the model and display the parameter in the drawing.
Example:
first6 = extract(rel_model_name(), 1, 6)
Martin Hanak
Martin Hanák
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The only way I know of is to define another parameter and use the "EXTRACT" function to pull the six characters you want from the string, such as:
substringDrawingName = EXTRACT ( dwg_name, 1, 6 )
Then use &substringDrawingName where you were using &dwg_name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you for your answers,
but, as I work on a 2d drawing (without any link with 3d, no model),
I can't have access to Relations.
