how to select shapes with width as variable in cql
try to look here
https://community.coreldraw.com/share/b/insider/posts/using-corel-query-language-cql-to-search-for-objects-in-coreldraw-documents
For example, to select all the rectangles wider than 2 inches execute the following VBA command:
ActivePage.Shapes.FindShapes(Query := "@type = 'rectangle' and @width > {2 in}").CreateSelection
in {2 in} if the "2" is variable W
maniktools said:in {2 in} if the "2" is variable W
Here's are two examples that uses a variable in the query.
Sub cql_test_1() Const dblRefWidthInches As Double = 2 ActivePage.Shapes.FindShapes(Query:="@type = 'rectangle' and @width > {" & CStr(dblRefWidthInches) & " in}").CreateSelection End Sub Sub cql_test_2() Dim sr As ShapeRange Dim dblRefWidthDocUnits As Double Const dblRefWidthInches As Double = 2 dblRefWidthDocUnits = ActiveDocument.ToUnits(dblRefWidthInches, cdrInch) Set sr = ActivePage.Shapes.FindShapes(Query:="@type = 'rectangle' and @com.SizeWidth > " & CStr(dblRefWidthDocUnits)) sr.CreateSelection End Sub
Thanks
another query
can u tell me cql for finding shapes with spot color