Delete me
As Paul mentioned, it could be the winding rule (could be set differently if one of your objects started out as text).
You could try running the following macro on the combined graphic.
Sub ToggleWindingRuleOfSelectedObjects() Dim s As Shape For Each s In ActiveSelection.Shapes If s.Type = cdrCurveShape Then If s.FillMode = cdrFillWinding Then s.FillMode = cdrFillAlternate Else s.FillMode = cdrFillWinding End If End If Next sEnd Sub
If this doesn't fix it, I might ask you to send me the file.
Regards,Hendrik
Yup, the winding rule fixed it. They should have a button to do this automatically. Or better yet, have it do it on its' own.
FosterCoburn said:Hendrik, Thanks for posting the cool macro. This would make a good built-in feature.
No prob, and I agree. Tony and I have spoken briefly about this one before, but other stuff seems to take precedence. I'll bring it up again.
More macros would be good too, it might also inspire people to create some of their own.
Hendrik Wagenaar said:Tony and I have spoken briefly about this one before, but other stuff seems to take precedence. I'll bring it up again.
Edit: Looked at your macro and it works great, but it doesn't change any curve directions, right? It only toggles the winding rule between Alternate and Winding. Not saying there's anything wrong with that, just thought it would be handy (and useful for engravers/vinyl cutters perhaps) with a command to correct the curve directions instead.
Ronny Axelsson said: Tony and I have spoken briefly about this one before, but other stuff seems to take precedence. I'll bring it up again.That would be really useful Hendrik, but seriously, it should be built in and not a macro. Edit: Looked at your macro and it works great, but it doesn't change any curve directions, right? It only toggles the winding rule between Alternate and Winding. Not saying there's anything wrong with that, just thought it would be handy (and useful for engravers/vinyl cutters perhaps) with a command to correct the curve directions instead. [/quote] Hi Ronny, Allow me to clarify, we discussed built in behaviour. Toggling the winding rule is the right way to do this. If the graphic designer wanted to keep the winding rule, then we'd have no way to predict what the he expects (for example, with figure eights, overlapping internal subpaths, etc.) If the graphic designer simply wants alternating fills, then switching the winding rule to "alternating" is sufficient. I guess what you're looking for isn't really related to the winding rule, is there a situation where you want every other internal subpath to have the opposite direction to the last subpath, for engraving or vinyl? Regards,Hendrik
Tony and I have spoken briefly about this one before, but other stuff seems to take precedence. I'll bring it up again.
[/quote]
Hi Ronny,
Allow me to clarify, we discussed built in behaviour.
Toggling the winding rule is the right way to do this. If the graphic designer wanted to keep the winding rule, then we'd have no way to predict what the he expects (for example, with figure eights, overlapping internal subpaths, etc.) If the graphic designer simply wants alternating fills, then switching the winding rule to "alternating" is sufficient.
I guess what you're looking for isn't really related to the winding rule, is there a situation where you want every other internal subpath to have the opposite direction to the last subpath, for engraving or vinyl?
Hendrik Wagenaar said:I guess what you're looking for isn't really related to the winding rule, is there a situation where you want every other internal subpath to have the opposite direction to the last subpath, for engraving or vinyl?
Extrudes and bevels can be cut, they just take a LOT of welding and fixing. ;)
In my experience engraving and CNC routing curve direction is usually determined by the routing software. What would be nice would be a function that allowed specification of a specific point as the begining or end of a given curve. I can't count how many times I've said "I wish the curve didn't start/end there". That would also help in cutting really long vinyl, where you can lose tracking over those long feed distances.
Last macro I'm writing:
This one, when run, will set the the first selected node of each subpath as the new start point of the subpath.
If you select multiple nodes on a single subpath, it will choose the first selected as the new start location. Open subpaths, and subpaths without a selected node are ignored. For easy use, place a button that calls SetStartNode() on the node edit property bar, or bind it to a key.
--------------------------------------------------------------------------------
Sub BreakAndJoinFirstSelected(sp As SubPath) Dim n As Node ' only set the start node on closed shapes If sp.Closed Then For Each n In sp.Nodes If n.Selected Then ' break apart at this node and rejoin n.BreakApart sp.StartNode.JoinWith sp.EndNode Exit For End If Next n End IfEnd Sub
Sub SetStartNodeToFirstSelected(s As Shape) Dim nr As NodeRange Dim sp As SubPath Dim ns As NodeRange ' breaking nodes clears the selection, we'll restore after each subpath Set ns = s.Curve.Selection ' go through each subpath, if anything is selected in it, reverse it. For Each sp In s.Curve.SubPaths BreakAndJoinFirstSelected sp ns.AddToSelection Next spEnd Sub
Sub SetStartNode() Dim s As Shape ' tool type not exposed through vba -- define it here Const cdrToolCurveEdit As Integer = 22 ' optimize to remove access flicking Application.Optimization = True ' begin a group of operations for undo ActiveDocument.BeginCommandGroup "Set Shape Start Node" ' only allow this macro to run if the node edit tool is selected If Application.ActiveTool = cdrToolCurveEdit Then ' go through each selected shape For Each s In ActiveSelection.Shapes If s.Type = cdrCurveShape Then SetStartNodeToFirstSelected s End If Next s End If ' select the pick tool and back to nodeedit to update the selection and UI Application.FrameWork.Automation.Invoke "f1aee54d-c9aa-4e6f-9193-82f496b0b72b" Application.FrameWork.Automation.Invoke "ae9f4ba1-2406-4dbc-b119-c12f9cca17f7" ' end the command group and restore the optimize flag ActiveDocument.EndCommandGroup Application.Optimization = False
End Sub
[Edit: I'm sure one of the VBA gurus could come up with an easier way to accomplish the same task.]
AWESOME! ;) Thanks!
I don't blame you for making that the last one you write. I would too. ;)