Message 1 of 3
iLogic/API: Override default name for new part created from template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When we create a new part using Application.Documents.Add(), the part takes on the default naming scheme for new parts, which is Part1, Part2, Part3, etc.
When my add-in creates a new part, I want to override the default starting name to something more specific to what my add-in is creating, e.g., "FlatBarPart1". I need this override to meeting the following requirements:
- Override is used for the title bar caption
- Override is used for the document tab caption
- Override is used for the browser tree top node
- Override is used as the default name when saving
- Override is NO LONGER USED once the file has been saved; instead, the filename specified by the user should be used in all places listed above. This should happen automatically without needing any extra event handling or logic (just as happens to the default "PartX" caption when the file is saved).
If I change the Document.DisplayName property, this meets requirements 1, 3, and 4 above, but not 2 and 5.
Is there some way to override the default starting name for a new, unsaved file, such that it's correctly displayed in all the places listed above, AND automatically gets replaced by the actual filename when the document gets saved?