carlopav wrote: ↑Fri Mar 27, 2020 6:01 pm...
1- we can't store it in Parameters, because the style is a document object: if we change document, the second maybe don't have the same style object....
If I'm not mistaken this is what the DraftToolBar is for. Many Draft commands basically look at this toolbar for configuration of their appearance, meaning line width, point width, colors, and even text size of Labels. These options are stored in the parameters. So, in my opinion, you could do the same and add more options to this toolbar, or even create a new toolbar only for your options.
What you are saying is you don't want that? You want an actual object to hold the configuration? If that's the case, your concept could be extended to the entire Draft workbench, so that there is a Draft object with configuration properties instead of the toolbar. I think at that point it becomes a bit of a discussion on software architecture. Is it better to have a real object? Or to have a toolbar that takes its properties from parameters?
About your DimensionStyle, it should probably be prefixed with the word "Draft", so that it's clear the configuration is specific to Draft objects, and not, say, TechDraw dimensions. It may look clear to power users, but many new users get confused easily.
Code: Select all
App.ActiveDocument.DraftDimensionStyles.ActiveDimensionStyle
By the way, I haven't tested your code so I'm still not exactly sure how all this is supposed to work. Maybe you can again explain your idea because I feel it has been evolving, and since you have closed and opened pull requests I'm losing track.
It's a configuration group, that holds configuration objects, which change how draft dimensions are created, and you can globally change this by using a different configuration object.
And you basically rewrote Draft Label, Draft Dimension, etc. (how many?), to use a parent class which is the one using the configuration set by the configuration objects above.
This sounds to me like two pull requests. One for the rewritten classes with a new parent class, and another one with the new configuration objects. Where would they be located in the Draft structure? Are you using all new locations of the source tree, or adding to Draft.py.