pyrevitlabs / pyRevit

Rapid Application Development (RAD) Environment for Autodesk Revit®
http://wiki.pyrevitlabs.io
GNU General Public License v3.0
1.24k stars 325 forks source link

Color Splacher Bugs #2067

Open Jgarcia094 opened 5 months ago

Jgarcia094 commented 5 months ago

**🙏 I don´t see any of this bugs reported.

🐞 Describe the bug

These are the bugs I've encountered, after half a dozen experiences using this feature:

  1. The parameter choice list displays several repeats and parameter names that are not available for the category (this one refered in one report).

  2. If the font size on the computer is enlarged above the recommended value (150%), the text of the dialog box is partially obscured (see image). Tested on a 4K screen with 175% enlarged text.

  3. When the parameter refers to a linear dimension (formatted by Length in Units) and the project unit for Length is meters or centimeters (and not milimeters), the filter values are wrong (see image).

♻️ To Reproduce

--

⏲️ Expected behavior

--

🖼 Screenshots of the issue

PyREVIT Color Splasher errors

🖥️ Hardware and Software Setup (please complete the following information):

jmcouffin commented 5 months ago
  1. Yep, something I know, and Revit Devs know too as it is following / providing the "complete" list of parameters through the Revit API. I could make it a set() by with the risk to miss some of them, there are different cases that I know of:

Category returns nothing, Worksets returns the list of workset for one, Design Option seems to have twice the same values (maybe due to cats like walls and curtain walls or inplace walls)., Railings are a good example, thanks, I would need to check what if the common denominator, but for now I would rather leave as is, rather than pretending that the tool provides all the parameters when I would do some post processing to remove the double parameters. What do you think.

Maybe checking if they hold value could help. I will keep the issue opened specifically to fix this one.

  1. I can't reproduce. I tried on Win10, Revit 2021 and 2024 @ 150% 175% 200% display and got this, no issue image It may be more of a Revit option or graphics card capabilities issue, IMHO. If you get the chance, try to reproduce on a different computer. That would help.

  2. I can't reproduce.

image

Jgarcia094 commented 5 months ago

Jean-Marc, thanks for your answer.

Related to topic 3, the problem can´t be seen in the imagens that you posted. The values in filter names are correct in meters (as in you images), but the correspondent values in Filters RULES are not in meters, and need to be manualy changed, as you can see in the attached image. PyREVIT Color Splasher Filter value error

jmcouffin commented 5 months ago

the problem can´t be seen in the imagens that you posted

yes, omission on my side, but trust me, I checked :) can you show your units setup?

Jgarcia094 commented 5 months ago

See, in the attached image, my Project Units definition. See also 2 new tests with another categories and the same problem.

I used REVIT 2024.2, but I tried in my REVIT 2022.1 also and the problem is the same.

If Length parameter = millimeters, the Filter Rules values are correct.

jmcouffin commented 5 months ago

@Jgarcia094 the image did not go through when you replied to the github email It does not take attachments

Jgarcia094 commented 5 months ago

Color Slpacher Filter values error and Project Units

Jgarcia094 commented 5 months ago

As soon as possible, I will try in other computers.

Jgarcia094 commented 5 months ago

The error is related to the decimal separation symbol used and not to the unit chosen in the Length parameter. If the symbol is a comma and the decimal place number is equal to 2, the filter rule value is multiplied by 100, and is multiplied by 10 when the decimal place number is equal to 1. To avoid error, the separation symbol must be a dot.

jmcouffin commented 5 months ago

That helps a lot @Jgarcia094 thanks. Would you care trying this fix on your install:

  1. alt+click to find the file when clicking on the color splasher https://github.com/eirannejad/pyRevit/blob/57c54be397a18b42cafd6319aa9d81a75bde8dac/extensions/pyRevitTools.extension/pyRevit.tab/Analysis.panel/ColorSplasher.pushbutton/script.py#L355

  2. replace this

                        value = float(sub("[^-\d|.]", "", item._value))

    for

                        value = float(sub("[^-\d|.|,]", "", item._value))
Jgarcia094 commented 4 months ago

After changing “script.py” file and reinitiate REVIT, I received one error (attached image) that prevents filters from being created. Color splacher error

jmcouffin commented 4 months ago

Ok, I will have to dig deeper. Kind of hard as I cannot reproduce the same things.

Jgarcia094 commented 4 months ago

If you choose comma as decimal separator, you can't reproduce the error?

jmcouffin commented 4 months ago

If you choose comma as decimal separator, you can't reproduce the error?

Nope