Hi folks,
I have been working on a bit of CQL to get the inner border of a drawing that was exported from CAD (so everything is a series of individual line shapes).
The way our drawings are set up the origin (0, 0) is near the centre of the drawing. In this case, the left-most edge of the drawing page is at -12.5 inches.
I want to set my query to create a shaperange of the items that are to the right of this edge. There are some marks on the left-most edge of the drawing that I wanted to avoid, so I put together the following statement: dim borderRange as ShapeRange Set borderRange = ActiveDocument.ActivePage.Shapes.FindShapes(Query:="@com.layer.name = '9' & @centerX > {-12.2 in} & @type= 'curve'")
And VBA throws an error "Error parsing query: Unit numeric value expected at position 37"
So from what I've figured out, this error is created by having a negative value (-12.2). If I change this to any number that is zero or higher the query works (but obviously doesn't capture what I need).
Is there a way to represent a negative number in this query, or am I going about this in the wrong way?
That post is a mess. The code is:
Dim borderRange As ShapeRange
Set borderRange = ActiveDocument.ActivePage.Shapes.FindShapes(Query:="@com.layer.name = '9' & @centerX > {-12.2 in} & @type= 'curve'")
Topics like this are better answered over on the Developer forum: Forums - Developer Area - CorelDRAW CommunityYou just need to move your negative outside the bracket like this:
Dim borderRange As ShapeRange Set borderRange = ActiveDocument.ActivePage.Shapes.FindShapes(Query:="@com.layer.name = '9' & @centerX > -{12.2 in} & @type= 'curve'")
Happy coding,
-Shelby
Oh my gosh, so straightforward!
Thanks for the hint about the proper discussion group as well.