Hi,
I have an outline shape selected. To reduce the number of nodes, I do it manually as:
1. Click Shape Tool
2. Click "Select all nodes" button on the toolbar
3, Click Reduce nodes button on the toolbar
That works fine but how do I achieve this in VBA?
I tried this:
shp.Curve.Nodes.All.AutoReduce (0.5)
But the results don't match with the result of manual work. Further, the manual work did not require any "Precision Margin" value like 0.5 here.
Thanks.
Mehdi
Hi bud,
That's a good question and something I would also like to know!
As you rightly pointed out autoreduce nodes isn't the same as the 'Reduce Nodes' button. The autoreduce nodes method is destructive and generally not much use, whereas the button rarely alters artwork and also fixes several other issues with curves.
I've briefly looked into without being able to figure out... I suspect you can use the custom command on it but I could never get my head around making that work for reduce nodes.
community.coreldraw.com/.../shape.customcommand
It's not elegant, but sometimes one can get something done by "pushing the button" in code. Suss out what the GUID is, then use InvokeItem:
1 2 3 4 5 6 7
Sub test_reduce_nodes() ActiveTool = cdrToolNodeEdit ActiveShape.Curve.Nodes.All.CreateSelection ActiveWindow.Activate Application.FrameWork.Automation.InvokeItem "b714bc06-7325-4d33-b330-4f4efec22c91" End Sub