DocumentName without extension?

Hi, I’m renaming a group of objects with DocumentName + Date + Time and I’d like to remove .3dm from the DocumentName before adding Date & Time. Could anyone advise, please?

I’m a total newb, obv.

This would be for RhinoScript, btw, not python.

TIA

Hi @declan, does this help:

Option Explicit

Call Main()
Sub Main()

    Dim strDocName, strNameOnly, fso
        
    strDocName = Rhino.DocumentName()
    If IsNull(strDocName) Then Exit Sub
    
    Set fso = CreateObject("Scripting.FileSystemObject")
    strNameOnly = fso.GetBaseName(strDocName)
    
    Rhino.Print strNameOnly

End Sub

_
c.

1 Like

Thanks Clement! (& @Dale)