Search by attributes

Here everybody can post his problems with PhotoLine
Juan
Mitglied
Posts: 615
Joined: Thu 06 Oct 2011 08:08

Search by attributes

Post by Juan »

Hi all,

Is it possible to search/select only the layers that match the same attributes?
Let me explain further, I have a PDF from a CAD software and I need to select all the layers that has the same RGB values.

Cheers,
Juan
Martin Huber
Entwickler
Entwickler
Posts: 4239
Joined: Tue 19 Nov 2002 15:49

Re: Search by attributes

Post by Martin Huber »

Juan wrote: Thu 07 Mar 2019 13:34Is it possible to search/select only the layers that match the same attributes?
Let me explain further, I have a PDF from a CAD software and I need to select all the layers that has the same RGB values.
The search function of the Layer List has basic support for vector colors.
The search string

Code: Select all

&vec+(&linecolor=rgbff0000 &fillcolor=rgbff0000)
will list all vector layers whose fill color or line color is red. The color format is an usual HTML color value.

More complicated queries could be handled by scripting.

Martin
Juan
Mitglied
Posts: 615
Joined: Thu 06 Oct 2011 08:08

Re: Search by attributes

Post by Juan »

Thank you so much for the script, now I have another question. If I want to select only by fill color and ignore the line color (many vector layers has different line colors,that's why). In my case specifically the vector layers have color fill but the line is set to 0% Opacity. Is it possible?

Cheers,
Juan
Martin Huber
Entwickler
Entwickler
Posts: 4239
Joined: Tue 19 Nov 2002 15:49

Re: Search by attributes

Post by Martin Huber »

Juan wrote: Thu 07 Mar 2019 20:54 Thank you so much for the script, now I have another question. If I want to select only by fill color and ignore the line color (many vector layers has different line colors,that's why). In my case specifically the vector layers have color fill but the line is set to 0% Opacity. Is it possible?
Checking only the fill color is easy:

Code: Select all

&vec+&fillcolor=rgbff0000
You can't check the opacity of the color, though.

Martin
Juan
Mitglied
Posts: 615
Joined: Thu 06 Oct 2011 08:08

Re: Search by attributes

Post by Juan »

Awesome, thank you :)
Juan
Mitglied
Posts: 615
Joined: Thu 06 Oct 2011 08:08

Re: Search by attributes

Post by Juan »

Hi all,

Can this search command be turned into a script?

Cheers,
Juan
Martin Huber
Entwickler
Entwickler
Posts: 4239
Joined: Tue 19 Nov 2002 15:49

Re: Search by attributes

Post by Martin Huber »

Juan wrote: Tue 23 Apr 2019 14:57Can this search command be turned into a script?
I don't quite understand what you mean.
You can't write a script that modifies which layers are visible in the Layer List.
You can write a script that selects layers depending on their attributes or edit them depending on their attributes. There are sample scripts that perform editing (DashedRedLine, DoubleLineWidth, TextReplaceRGBBlack).

Martin
Juan
Mitglied
Posts: 615
Joined: Thu 06 Oct 2011 08:08

Re: Search by attributes

Post by Juan »

Martin Huber wrote: Thu 25 Apr 2019 11:48 You can write a script that selects layers depending on their attributes or edit them depending on their attributes. There are sample scripts that perform editing (DashedRedLine, DoubleLineWidth, TextReplaceRGBBlack).
Thanks for pointing me out in the right direction.

Cheers,
Juan
Juan
Mitglied
Posts: 615
Joined: Thu 06 Oct 2011 08:08

Re: Search by attributes

Post by Juan »

I'm not sure why but I'm not able to select any vector layer that contains this color value (#edd9b8) using this

Code: Select all

&vec+&fillcolor=rgbedd9b8
:
Colorvalue.jpg
Cheers,
Juan
You do not have the required permissions to view the files attached to this post.
User avatar
Gerhard Huber
Entwickler
Entwickler
Posts: 4190
Joined: Mon 18 Nov 2002 15:30
Location: Bad Gögging

Re: Search by attributes

Post by Gerhard Huber »

I tested this right now here and it works fine.
Perhaps you should switch off and on the search function, sometimes this is necessary.
Juan
Mitglied
Posts: 615
Joined: Thu 06 Oct 2011 08:08

Re: Search by attributes

Post by Juan »

Gerhard Huber wrote: Fri 26 Jul 2019 10:16 I tested this right now here and it works fine.
Perhaps you should switch off and on the search function, sometimes this is necessary.
Thanks, but no luck for me here :(
Here is a small sample file where I need to select the vector layer using the script (since the real document has few dozens of that layer). For me the script works perfectly if the vector layer is pure red.
Color selection.pld
Cheers,
Juan
You do not have the required permissions to view the files attached to this post.
User avatar
Gerhard Huber
Entwickler
Entwickler
Posts: 4190
Joined: Mon 18 Nov 2002 15:30
Location: Bad Gögging

Re: Search by attributes

Post by Gerhard Huber »

I see the problem. That's float value issues. We will fix this in the next version of PhotoLine.
Juan
Mitglied
Posts: 615
Joined: Thu 06 Oct 2011 08:08

Re: Search by attributes

Post by Juan »

Gerhard Huber wrote: Fri 26 Jul 2019 10:39 I see the problem. That's float value issues. We will fix this in the next version of PhotoLine.
Thank you for the confirmation.

Cheers,
Juan