In the documentation cql is mentioned as query language for complex shape searching.
But all examples i find are for vba where it can be used in findshapes:
ActivePage.Shapes.FindShapes(Query:="@outline.type = 'none' and @fill.type = 'none'")but how do i use this in vsta (c#)?thanks in advanceTom
What did you try?
It should be something similar. This line should work:
corelApp.ActiveDocument.ActivePage.Shapes.FindShapes(null, corel.cdrShapeType.cdrNoShape, true, "@outline.type = 'none' and @fill.type = 'none'");
You can 'help' the function (if the case) using the shape name instead of 'null', the shape type for the second parameter...
I think this code should also work (even more similar). I cannot test it...
corelApp.ActiveDocument.ActivePage.Shapes.FindShapes(Query:"@outline.type = 'none' and @fill.type = 'none'");
Of course, you must allocate the function result to a ShapeRange variable...
In fact, when you open the function parenthesis VS will show you which to be the accepted options for the parameters.
visual studio indeed gives a tooltip of the function but it only has 3 parameters name type and recursive so the first example does not work, i thought at least.
But apparently the function activePage.findShapes has 3 arguments but the function activePage.Shape.findShapes has four.
how bizar, so thank you for pointing this out, it compiles now.
FindShapes has 4 parameters... You are missing exactly the Query parameter.
"Optional ByVal Name As String, Optional ByVal Type As cdrShapeType = cdrNoShape, Optional ByVal Recursive As Boolean = True, Optional ByVal Query As String"
Does it work, or not? I did not understand this aspect...
Does the second one work? Did you try it?
The main problem was that i took the findshapes function directly from activepage and not from the shapes member in activepage. So the first version works, the problem is the api of coreldraw that is not logic.
Only now I understood what you meant...
But ActivePage.FindShapes does not offer the possibility of CQL using. Neither in VBA...