Skip to content

retrieve a document's tab color from a C# addin #2800

@RevitIRL

Description

@RevitIRL

Is your feature request related to a problem? Please describe

I've got a C# add-in with some document-specific UI elements that I'd like to color to match the pyRevit tabs.

Describe the solution you'd like

Given the Document element (or HashCode, or however pyRevit keeps track of it), I'd like to query pyRevit to find the corresponding color being used.

Describe alternatives you've considered

I've considered taking my color list ["#FFFBDEAE","#FFC8D5E1","#FFAAAAFF","#FFAAFFAA","#FFFFFFAA","#FFAAD5FF","#FFFFC1AA","#FFAAFFFF","#FFDDEEBB","#FFFFAAD9"] and writing my own code to keep track of the documents and colors, but I've occasionally had issues with missing document events and I'm concerned with the colors getting out of sync. Also, the users are technically able to set their own colors (even if not likely to do so). Re-using the same colors (which I like), while not being able to guarantee that they match throughout the interface would be horrible (I'd be better off using completely different colors to avoid confusing the user, but having them identical would be so much better). Also, if dark support is added in the future, that would add yet another issue.

Additional context

I've used ChatGPT to translate the occasional python to C# for me to understand what's going on, but I have no direct python experience, and I wasn't able to figure out if it's already possible to do this just by looking at the code base.

Metadata

Metadata

Assignees

No one assigned

    Labels

    New FeatureNew feature request [class->Implemented #{number}: {title}]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions