View Single Post
  #2  
Old 20-08-2010, 13:09
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,790
Blog Entries: 13
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default CQL and C#

Here is a simple example of how to use C# and CQL. I tested this example with VSTO and CorelDRAW X5. The example creates three rectangles then selects one of them using CQL.
Code:
Document doc = app.CreateDocument();
Shape sRectLarge = doc.ActiveLayer.CreateRectangle2(0, 0, 3, 3, 0, 0, 0, 0);
Shape sRectMedium = doc.ActiveLayer.CreateRectangle2(4, 0, 1, 1, 0, 0, 0, 0);
Shape sRectSmall = doc.ActiveLayer.CreateRectangle2(6, 0, .5, .5, 0, 0, 0, 0);

sRectLarge.Fill.UniformColor.CMYKAssign(0, 100, 100, 0);
sRectMedium.Fill.UniformColor.CMYKAssign(0, 100, 100, 0);
sRectSmall.Fill.UniformColor.CMYKAssign(0, 100, 100, 0);

ShapeRange srFoundShapes = doc.ActivePage.Shapes.FindShapes(null, cdrShapeType.cdrNoShape, true, "@width = {1 in} and @fill.color = cmyk(0,100,100,0)");
srFoundShapes.CreateSelection();
Best of luck,

-Shelby
Reply With Quote