Macro Language Reference > Macros > Application > ttundogroup
  
ttundogroup
Description
Controls the grouping of consecutive text change records for an undo operation.
Syntax
ttundogroup mode:n
mode
1
Turn manual grouping on.
0
Turn manual grouping off (return to auto grouping)
Additional Information
When PTC ALD performs certain actions that result in multiple changes to a text stream, such as a spell check or global search/replace, all the changes are grouped together under a single 'transaction' so that a single undo operation will revert them all at once. This new macro lets the user group changes in a similar way from a script. Manual grouping overrides all PTC ALD grouping.
PTC ALD also normally combines adjacent edits of the same type into a single undo record. For example, simply typing a sentence is really many edits of 1 character insertion each. A single undo will remove the whole typed sequence in one hit. This new macro has a second purpose and that is to isolate changes that might normally be combined with other adjacent changes. For example: type a word, switch on manual grouping, type another word, switch off manual grouping, type a third word. It will take three undo operations to remove all the words.
 
Note that undo grouping, manual or otherwise, has nothing to do with Revision Markers. That system is independent of undo records and has its own rules for combining adjacent edits of various kinds.
Undo grouping is a document level setting and will work across multiple streams, as long as the individual streams have their 'record undo information' setting enabled.
When enabling manual undo grouping in a script for a sequence of operations you should take care to ensure that the corresponding return to auto grouping is executed as well, otherwise the next undo operation from the user will undo everything back to the time manual grouping was enabled.