OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 18-08-2010, 03:58
ljesus7
Guest
 
Posts: n/a
Default How to use a CQL on C# (4GL Language)

Hello~ It's a hotter than I remember.. wow

As you can see, How do I wonder about using a CQL on C#(4GL)
If somebody who have solved a problem here, would you tell me a way to
use a CQL

Thks Best Regards...
Reply With Quote
  #2  
Old 20-08-2010, 14: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
  #3  
Old 26-08-2010, 07:09
ljesus7
Guest
 
Posts: n/a
Default Thanks For your Reply

Code:
 
// Shape Error Check
if (corel.ActiveDocument.ActivePage.Shapes.FindShapes(string.Empty, cdrShapeType.cdrNoShape, true, 
"@type='3DObject' or 
@type='ArtisticMediaGroup' or
@type=BevelGroup or 
@type=BlendGroup or 
@type=Connector or 
@type=ContourGroup or 
@type=CustomEffectGroup or 
@type=CustomEffectGroup or 
@type=DropShadowGroup or 
@type=ExtrudeGroup or 
@type=HTMLActiveObject or 
@type=HTMLFormObject or 
@type=LinearDimension or 
@type=MeshFill or 
@type=OLEObject or 
@type=Perfect or 
@type=Symbol or 
@type=text").Count != 0)
           {
                throw new Exception();
            }

            if (corel.ActiveDocument.ActivePage.Shapes.FindShapes(string.Empty, cdrShapeType.cdrNoShape, true, "@color.IsCMYK = false").Count != 0)
            {
                throw new Exception();
            }

 Top of the page has a type check and color check using a CQL, but I don't know what Effect Check
 As you can see, CorelDraw have a lot of many type object.. so I would like to know how to find a lot of many object information using a CQL
 For example. 
 
 CQL Manual
 Returns an array of colors used in the fill and the outline of the shape. 
 This array contains only unique colors, so if both the fill and the outline have the same color, only one color will be returned
 @colors.find(cmyk(0,0,0,100)) => finds if the shape contains a CMYK black color
 !@color.filter($item.cmyk.k <> 0).empty => Finds if the shape has any color that has non-empty black color component.

                if (sh.Shapes.FindShapes(string.Empty, cdrShapeType.cdrNoShape, true, "@color.cmyk.k <> 0 and @fill.Type = 'uniform'").Count > 0)
                {
                    color = 1;
                }

                if (sh.Shapes.FindShapes(string.Empty, cdrShapeType.cdrNoShape, true, "(@color.cmyk.c + @color.cmyk.m + and @color.cmyk.y + @color.cmyk.k = 0) or 
                (@color.cmyk.c + @color.cmyk.m + and @color.cmyk.y) and  @fill.Type = 'uniform'").Count > 0)
                {
                    color = 4;
                }
How to Check a Black Color [range 0 to 100] , How to check a CMYK Color without @color.IsCmyk , How to check a object included Effect [Blend, Extrude, PowerClip, Fountain, Etc]
Thank For you Replay again

Last edited by ljesus7; 26-08-2010 at 07:20.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to detect textbox's language or charset? litthe CorelDRAW/Corel DESIGNER VBA 1 24-03-2009 20:52
Add the Language mariz777 Calendar Wizard 0 25-11-2007 03:51
Lost Language duinker Calendar Wizard 2 12-11-2004 10:13
problems with dates when language is set to French Canadian shelley Calendar Wizard 1 19-10-2004 08:17


All times are GMT -5. The time now is 22:20.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com