- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a macro, written in C#, that will find all text notes that match the above pattern in the file and update them with a formatted version of the current date (e.g. 06JUN2021). In the off chance that someone else utilizes this format in another location where it is not the only content of the text note, where we would not want to overwrite the whole thing with the date and I am no longer on the project, we need to ensure it only captures text notes that contain exactly this pattern.
Before posting, I dug a little more, and found out that the issue was that every text note object inserts the character "\r", or Carriage Return. I have to ask, why is this a functionality of Revit, and why is it not "\r\n" or, more common for coding, "\n" New Line? The New Line character is what most coding languages take and understand, and considering C# lacks "\r" as an end-of-line character and thus does not get recognized by things like Regex patterns ("$", "\Z", and "\z" do not work because the expect a "\n" and do not find one), it makes very little since Revit would maintain use of this character.
If anyone could explain to me what the logic is here, I would greatly appreciate it. Otherwise, I intend to make an Ideas post regarding this, as it can have some very annoying and possibly code breaking ramifications for API users.
Solved! Go to Solution.