OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 25-05-2006, 20:29
mgmcs
Guest
 
Posts: n/a
Question macro for break curve and join curve

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
Reply With Quote
  #2  
Old 26-05-2006, 15:07
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

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
this code was written just in two minutes here, in browser, I didn't test it


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.
Reply With Quote
  #3  
Old 26-05-2006, 22:01
mgmcs
Guest
 
Posts: n/a
Default

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. :-)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
vba question bumblebee CorelDRAW/Corel DESIGNER VBA 4 04-08-2004 15:07


All times are GMT -5. The time now is 02:34.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com