
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I would like to report the weird behaviour of Document.Title, specifically:
var activeDocTitle = commandData.Application.ActiveUIDocument.Document.Title;
Depending on your Windows Files and Folder settings, this will return:
- "revit_document_name.rvt" - if File name extensions is turned on or;
- "revit_document_name" - if File name extensions is off
Now, this may not look like like much of an issue, but in our code we had a little neat line that was something like:
var documentName = Path.GetFileNameWithoutExtension(activeDocTitle);
which was OK, until... someone had a document named "revit.document.name". Since we, as software engineers, like our files WITH their extensions and our users don't, this behaviour kinda wreck havoc around the office, until we pinpointed what is going on 🙂
The issue was manifested on Windows 10 machines using Revit 2016 and 2016 API as well on 2017.
It would be nice to make the Title property consistent regardless of Windows settings or at least document this behaviour in API docs.
Best regards,
Uros
Solved! Go to Solution.