How i can outlines in RGB(255,0,0) select on if statement?
In my example works the selection of 0.0762, but colors dont work.
1 2 3 4 5 6 7
foreach (corel.Shape sh in sr) { if ((sh.Outline.Width != 0.0762)&&(sh.Outline.Color != corelApp.Application.CreateRGBColor(255,0,0))) { sr.Remove(sr.IndexOf(sh)); } }
you cannot compare objects with Color-type this way. See methods of Color-class
in the meantime i tried a query. it works with the color selection. but not with the line thickness...sr = corelApp.ActiveSelection.Shapes.FindShapes(Query: "@outline.color = RGB(255, 0, 0)"); // find the color OK sr = corelApp.ActiveSelection.Shapes.FindShapes(Query: "@Outline.Width = 762"); // not works and gives a non-usable error message
How did you use it for that unit of measure (I never used)? Like CQL or by conditional iteration?
you mean this?corelApp.ActiveDocument.StyleSheet.FindStyle("~graphic~").Outline.Width = corelApp.ActiveDocument.ToUnits(762, corel.cdrUnit.cdrTenthMicron);
So, not CQL... I do not know what abbreviation to be used for 'cdrTenthMicron' like unit of measure in CQL.
I just had to find out what CQL is first. Google helps me ;-)Maybe you have a good documentation about CQL and corel?
No, I'm afraid such complete documentation does not exist... At least, it is not public. You cannot even search for it. I usually found some interesting approaches looking in Oberon forum and here. And experimenting by my own what I could imagine it may be working... I have the impression, maybe a wrong one, that Corel technical team does not share such documentation on purpose. It will be so easy do do it, with examples for each property, method. Only some people selling applications have/receive the information from them... Or some of them are the selling ones and company accepts this behavior.
FaneDuru,
Just a quick correction. :-) You can find the details about CQL here:
Using Corel Query Language (CQL) to Search for Objects in CorelDRAW and Corel DESIGNER Documents
Also this is another version that I pulled from the help file in an earlier version. I download this locally so that I can reference it quickly.
Corel Query Language (CQL) manual
Maybe it is time I do a blog article to make this all easier for everyone to find. :-)
Happy coding,
-Shelby
Many thanks Shelby.
Thanks, Shelby!
You are mostly right... I used some times the first link you posted, but I rarely could find there exactly what I was looking for. I probably must experiment more to be able to fill the missing gaps.
The second compact manual is really interesting.