hello, I use very often strokes that are just some drawing lines, and at the end mostly I need fills / objects. So I use the function to expand strokes, many years in Illustrator which was fine. But I would like to handle this in CorelDraw also, as I work more and more only in CorelDraw. The function to convert contours to objects (expand strokes) is ok but I wish there could be either more options or just better results :).
Is there perhaps anywhere a macro to download or buy which has just this function for expand strokes in CorelDraw?
Thank you.
Convert Outline to Object works pretty good most of the times in my opinion, but may sometimes create some unnecessary nodes.Select all nodes and use Reduce Nodes in Property Bar afterwards, if it does. Keep an eye on the curves though since reducing the number of nodes may change the curves slightly.You can also try to use Contour instead of converting the curve but it takes a few more steps, especially if you want both the inner and outer edge of the "outline".These are the two options we have, and even if a macro was created, it would probably have to be based on either of these commands.
I asked this as I noticed that the outline to object works also differently in the different Corel version, but of course also differen from Illustrator (which I prefer for this function at the moment while I use CorelDraw for everything else).
I asked this also because I found in another forum a similar question and a user answered with a small macro. Not sure I am allowed to link to another forum and the macro code, the discussion was about converting cutlines to cbject.
When I tested this other macro, the result was quite different from the function in CorelDraw 2023. As I did not test long, I don't know if it works better, but it could be.
So after all I thought that there could be another macro (more recently) and perhaps a commercial macro for this.
thank you very much again, I understood this now! It is very obvious and good to know that this contour function is much better than then convert to object.
Perhaps I can record a macro when I always have the same outline width. Or even better something general always making this half width thing. But I don't know much about macros. Anyway, thanks!
hello and thanks again - I don't know the macros you mention, are those two different macros and where are they to choose?
Option ExplicitSub AddCutToOutline() Dim sr As ShapeRange, s As Shape Set sr = ActiveSelectionRange Optimization = False For Each s In sr If s.Outline.Justification = cdrOutlineJustificationMiddle And s.Outline.LineJoin = cdrOutlineRoundLineJoin Then Call CenterOutlineRound Else If s.Outline.Justification = cdrOutlineJustificationMiddle And s.Outline.LineJoin = cdrOutlineMiterLineJoin Then Call CenterOutlineSquare Else If s.Outline.Justification = cdrOutlineJustificationOutside And s.Outline.LineJoin = cdrOutlineMiterLineJoin Then Call OutsideOutlineSquare Else If s.Outline.Justification = cdrOutlineJustificationOutside And s.Outline.LineJoin = cdrOutlineRoundLineJoin Then Call OutsideOutlineRound Else If s.Outline.Justification = cdrOutlineJustificationInside Then Call InsideOutline End If End If End If End If End If Next sOptimization = FalseActiveWindow.RefreshEnd Sub
Sub CenterOutlineRound() 'only works on 1 shape Dim sr As ShapeRange, a#, s As Shape ActiveDocument.Unit = cdrInch Set sr = ActiveSelectionRange Optimization = True For Each s In sr a = s.Outline.Width If s.Outline.Justification = cdrOutlineJustificationMiddle Then If s.Outline.LineJoin = cdrOutlineRoundLineJoin Then Dim eff1 As Effect Set eff1 = sr(1).CreateContour(1, a / 2, 1, 0, CreateCMYKColor(0, 99, 0, 0), CreateColor, CreateCMYKColor(0, 0, 0, 100), 0, 0, 2, 4, 15#) With eff1.Contour .EndCapType = 1 .CornerType = 2 .Parent.Separate.CreateSelection End With sr.RemoveFromSelection ActiveSelection.Fill.ApplyNoFill ActiveSelection.Outline.Width = 0.003 ActiveSelection.OrderToFront sr.RemoveFromSelection
End IfEnd If
Next sOptimization = FalseActiveWindow.Refresh
End Sub
Sub CenterOutlineSquare() Dim sr As ShapeRange, a#, s As Shape ActiveDocument.Unit = cdrInch Set sr = ActiveSelectionRange Optimization = True For Each s In sr a = s.Outline.Width If s.Outline.Justification = cdrOutlineJustificationMiddle Then If s.Outline.LineJoin = cdrOutlineMiterLineJoin Then Dim eff1 As Effect Set eff1 = sr(1).CreateContour(1, a / 2, 1, 0, CreateCMYKColor(0, 99, 0, 0), CreateColor, CreateCMYKColor(0, 0, 0, 100), 0, 0, 2, 4, 15#) With eff1.Contour .EndCapType = 1 .CornerType = 3 .Parent.Separate.CreateSelection End With sr.RemoveFromSelectionActiveSelection.Fill.ApplyNoFillActiveSelection.Outline.Width = 0.003ActiveSelection.OrderToFrontEnd IfEnd Ifsr.RemoveFromSelectionNext sOptimization = FalseActiveWindow.Refresh
Sub InsideOutline() Dim sr As ShapeRange, a#, s As Shape ActiveDocument.Unit = cdrInch Set sr = ActiveSelectionRange Optimization = True For Each s In sr a = s.Outline.Width If s.Outline.Justification = cdrOutlineJustificationInside Then Dim eff1 As Effect Set eff1 = sr(1).CreateContour(cdrContourOutside, 0.001, 1, 0, CreateCMYKColor(0, 99, 0, 0), CreateColor, CreateCMYKColor(0, 0, 0, 100), 0, 0, 2, 4, 15#) With eff1.Contour .EndCapType = 1 .CornerType = 3 .Parent.Separate.CreateSelection End With sr.RemoveFromSelectionActiveSelection.Fill.ApplyNoFillActiveSelection.Outline.Width = 0.003ActiveSelection.OrderToFront
Set eff1 = ActiveSelection.CreateContour(cdrContourInside, 0.001, 1, 0, CreateCMYKColor(0, 99, 0, 0), CreateColor, CreateCMYKColor(0, 0, 0, 100), 0, 0, 2, 4, 15#) With eff1.Contour .EndCapType = 1 .CornerType = 3 .Parent.Separate.CreateSelection End With sr.RemoveFromSelection ActiveSelection.Fill.ApplyNoFillActiveSelection.Outline.Width = 0.003ActiveSelection.OrderToFrontActiveSelection.Shapes.First.RemoveFromSelectionActiveSelection.Delete
End IfNext sOptimization = FalseActiveWindow.RefreshEnd SubSub OutsideOutlineSquare() Dim sr As ShapeRange, a#, s As Shape ActiveDocument.Unit = cdrInch Set sr = ActiveSelectionRange Optimization = True For Each s In sr a = s.Outline.Width If s.Outline.Justification = cdrOutlineJustificationOutside Then If s.Outline.LineJoin = cdrOutlineMiterLineJoin Then Dim eff1 As Effect Set eff1 = sr(1).CreateContour(1, a, 1, 0, CreateCMYKColor(0, 99, 0, 0), CreateColor, CreateCMYKColor(0, 0, 0, 100), 0, 0, 2, 4, 15#) With eff1.Contour .EndCapType = 1 .CornerType = 3 .Parent.Separate.CreateSelection End With sr.RemoveFromSelectionActiveSelection.Fill.ApplyNoFillActiveSelection.Outline.Width = 0.003ActiveSelection.OrderToFront
Next sOptimization = FalseActiveWindow.RefreshEnd SubSub OutsideOutlineRound()Dim sr As ShapeRange, a#, s As Shape ActiveDocument.Unit = cdrInch Set sr = ActiveSelectionRange Optimization = True For Each s In sr a = s.Outline.Width If s.Outline.Justification = cdrOutlineJustificationOutside Then If s.Outline.LineJoin = cdrOutlineRoundLineJoin Then Dim eff1 As Effect Set eff1 = sr(1).CreateContour(1, a, 1, 0, CreateCMYKColor(0, 99, 0, 0), CreateColor, CreateCMYKColor(0, 0, 0, 100), 0, 0, 2, 4, 15#) With eff1.Contour .EndCapType = 1 .CornerType = 2 .Parent.Separate.CreateSelection End With sr.RemoveFromSelectionActiveSelection.Fill.ApplyNoFillActiveSelection.Outline.Width = 0.003ActiveSelection.OrderToFrontEnd IfEnd IfNext sOptimization = FalseActiveWindow.RefreshEnd SubSub Macro1()End Sub
thank you very much! I could add the macro and it seems all is working.
The result in my first test is much better than the same function from CorelDraw :).
But honestly I do not know the difference between the single steps, or if I need all.
And could there be at the end the automatic delete of the curve while keeping the new objekt with not outline and the fill in the color of the curve before? That would be perfect.
...And could there be at the end the automatic delete of the curve while keeping the new objekt with not outline and the fill in the color of the curve before? That would be perfect...
I'm not following you here.
Use this image to describe how you would like the end result to be. Cut line to be the same color as the outline or...?
I started this because the CorelDraw function for "Convert Outline to Object" (similar from German) is making some trouble with extra nodes, steps and so on. Usually I draw or import curves (drawn by hand) and would like to make them to objects at a certain time.
So I have curves with an outline, and as result I want to have an objekt looking as the curve before, but as object = fill, and then no outline.
In Illustrator it's called expand strokes, I think. In CorelDraw the mentioned "convert".
So when I choose one, several or all of your macros, at the end I get a really nice object, but - in my case perhaps wrong - I still have the curve / outline there, and the object has no fill.
I attach also an image. Normally it would be ok to have the solution at the bottom and described in my last answer. But when I think about it, of course it can happen that the curve is closed and even filled, this would be the examples at the top of the image.
But the priority is the normal drawing lines in black only, those I would like to convert to objects as in your macros, but which should I use and could be the object at the end filled and the outline (old) deleted?
I found out how to change the color, it would be adding the following at the end of one of your macros:
ActivePage.SelectableShapes.All.CreateSelectionActiveSelection.Outline.SetProperties Color:=CreateRGBColor(0, 0, 0) ActiveSelection.Outline.SetProperties Width:=0 ActiveSelection.Fill.ApplyUniformFill CreateRGBColor(0, 0, 0)
But when I have several shapes, only one shape is changed by the macro, correct?
(I found one comment of you, but only for the second macro, so are all of the macros only changing one shape - perhaps I could add a line to change all shapes in the page - this could work by combining all shapes and then after the macro undo it?)