pyRevit icon indicating copy to clipboard operation
pyRevit copied to clipboard

Keynote Manager does not sort new keynotes.

Open martinservold opened this issue 3 years ago • 2 comments

Keynote manager should auto sort new/edited keynote entries so that if someone opens the txt file manually they are not all out of order.

You'd need to change something in here:

pyRevit/dev/pyRevitLabs/pyRevitLabs.DeffrelDB/DefaultDataFormatter.cs

  public EntryChangeRequest BuildRecordEntry(List<string> dstoreEntries,
                                                   DataStoreType dstoreType,
                                                   DatabaseDefinition dbDef,
                                                   TableDefinition tableDef,
                                                   IDictionary<string, object> fieldValues) {

            var tableRange = extractTableRange(dstoreType.TypeName, dstoreEntries, dbDef, tableDef);

            return new EntryChangeRequest(
                EntryChangeType.Insert,
                tableRange.Last + 1,
                buildRecordentry(tableDef, fieldValues)
                );
        }

tableRange.Last + 1,

Or have it call a new Sort function after each entry change. Possibly in the: dev/pyRevitLabs/pyRevitLabs.DeffrelDB/DataFunctions.cs

private static void ProcessChangeRequest(DataStore dstore, EntryChangeRequest ecReq) {

In our circumstance, we have Mechanical, Electrical, Plumbing, & Technology keynotes in the same txt file, but they have different prefixes for the keynote values. EG: M1, E1, P1, T1. And these are just being appended to the end of the file right now instead of grouped with their other keynotes.

martinservold avatar Mar 24 '22 00:03 martinservold

The other option would to have different lock tables for each parent key, but I don't think that's a good option because it would get messy and unreadable really fast.

martinservold avatar Mar 24 '22 00:03 martinservold

my team don't even open the txt file, no need for that! your team should avoid that too ;)

PAYAM2000 avatar May 12 '22 05:05 PAYAM2000