DataStandard - Get 'DocNumber' without Extension

DataStandard - Get 'DocNumber' without Extension

m_hermann
Collaborator Collaborator
376 Views
2 Replies
Message 1 of 3

DataStandard - Get 'DocNumber' without Extension

m_hermann
Collaborator
Collaborator

Hello,

 

$Prop["DocNumber"].Value gives me the filename with extension.

How can i trim the extension to get only the filename without extension?

 

thx for helping

0 Likes
Accepted solutions (1)
377 Views
2 Replies
Replies (2)
Message 2 of 3

Markus.Koechl
Autodesk
Autodesk
Accepted solution

There are multiple options, depending on the context.

$Prop["DocNumber].Value = $Prop["DocNumber"].Value.Replace($Prop["_FileExt"].Value, "")

Another is leveraging the PathAndFileName Handler like this

$Prop["DocNumber"].Value = $dsWindow.DataContext.PathAndFileNameHandler.FileNameNoExtension


Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
Message 3 of 3

m_hermann
Collaborator
Collaborator

Hi Markus,

 

second works.

Many thanks

0 Likes