![]() |
#1
|
|||
|
|||
![]()
Hi,
After using weld,trim,'convert to curves' or any such option, you see one node being shown with a larger square than others. Thats the starting point from where a machine will cut the figure. Corel decides this starting pt by default. But we can change it thru foll steps:- 1. select the shape tool. 2. click on any other node u want as the new starting point. 3. select the 'break curve' option 4. select the 'auto-close curve' option this is now the new starting pt for cutting the object. Now my problem starts here........ I want to automate this using a macro. I tried recording a macro for this. but corel does not generate any code for step1&2. so how do i know where the user has clicked ? and second, if u record the entire process & see the generated code, it will show a set of coordinate points and not just x & y. Where will i get these from in my macro. this is difficult to explain thru a thread, but if anyone has tried it before, pls help. thanks, maggie |
#2
|
||||
|
||||
![]()
just fast tips, going home now:
Code:
dim sh as shape, n as node, x as double, y as double, shift& if activedocument.getuserclick (x,y,0,true,cdrCursorNodeEdit)=0 then set sh=activepage.selectshapesAtPoint(x,y,true) if sh.shapes.count>0 then set sh=sh.shapes(1) set n=sh.Curve.FindNodeAtPoint(x,y) if not n is nothing then n.breakapart sh.curve.nodes.last.joinWith sh.curve.nodes.first end if end if end if by the way I do this operation manually (very rarely) - here is a tip: assign j to node-join, Shift-J to node-break-apart, then double click you node - you will enter node-edit with this node selected, press Alt-J, draw a marqee around two resulting nodes, press J Last edited by wOxxOm; 26-05-2006 at 15:10. |
#3
|
|||
|
|||
![]()
at the first try, ur code worked !! thanks a lot. I have been trying this for so long. The macro that Corel generated was like this. -
Dim crv As Curve Set crv = ActiveDocument.CreateCurve() With crv.CreateSubPath(5.168406, 8.88498) .AppendLineSegment 5.168406, 6.549606 .AppendLineSegment 2.019587, 6.549606 .AppendLineSegment 2.019587, 8.88498 .AppendLineSegment 5.168406, 8.88498 End With ActiveSelection.Curve.CopyAssign crv OrigSelection(1).Curve.Closed = True and i was trying to manipulate this. I will go thru your code in detail and will test for a couple of options. will get back in case of any furthur problem. but thanks a lot. u were of great help. :-) |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
vba question | bumblebee | CorelDRAW/Corel DESIGNER VBA | 4 | 04-08-2004 15:07 |