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
Please, try it in the next way:
Set shR = ActiveSelection.Shapes.FindShapes(Query:="@outline.color = RGB(225, 0, 0) and @outline.width = {762 mm}") shR.CreateSelection
Please, use the unit of measure, as the above code shows. But, what are these used 762? Millimeters?
Hi FaneDuruThe 762 is the thickness of a hairlinecorelApp.ActiveDocument.StyleSheet.FindStyle("~graphic~").Outline.Width = corelApp.ActiveDocument.ToUnits(762, corel.cdrUnit.cdrTenthMicron);
Many thanks! This works :-)
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);