I can select all objects in current layer with the following
but, how do I loop through all layers and add their shapes to Selection?
Thanks; even more beautiful!
FaneDuru said:Anyhow Eskimo's code remains the most beautiful... :-)
Thank you for the kind words!
I am not an expert on CQL, but it has really changed how I approach a lot of tasks in CorelDRAW.
It is difficult to become a CQL expert, looking only to what you can find here. And something else (coming from Corel) I did not see, even if I would study it with a lot of joy... I have an Excel file with a dedicated page to CQL code examples. I created something just using my imagination and others coming from here, Oberon etc. mostly from Shelby.
You must cultivate your imagination and just try. Looking to Intellisense suggestions and try.
I did not imagine such a way. Now being inspired (by you) the code can be made even shorter:
ActivePage.Shapes.FindShapes(, , False, "@type != 'guide' and @com.layer.isSpeciallayer = 'False'").CreateSelection
IsSpecialLayer returns true in case of guideline, desktop, or grid layers... The guide shape must be checked because if you copy one and an ordinary layer is active, it is copied on this one after Paste. It happened to me many times especially when I tried to copy guide lines inclined with a specific angle.
Yes, lots of great CQL stuff from Shelby.
One I especially like from Shelby is a description of how to use a custom function in a CQL query.
That makes it possible to use CQL to search based on custom object properties.
I know the method and I used it...
Powerful this CQL, but too less code examples. Unfortunately I did not build a reflex to treat all from the CQL perspective. I firstly try in the old style coming from the Excel VBA experience. When I try CQL, very seldom I cannot solve the problem in this (nice) way...