![]() |
#1
|
|||
|
|||
![]()
Been programming in VB, but new to VBA with corel x3.
to start what I want to do, I have to insert a node in a existing path, at a point where I double click, (like double clicking in shape tool mode). I will be doing a few things with that point once created, so I need to reference this new point in my code. I need to do this in the VBA code, since I will be creating quite a few new nodes to do what I want. Once I get to this point, I should be OK.. Just hitting a road block getting started. ![]() Thanks. |
#2
|
||||
|
||||
![]()
something like this, a non-tested rip from my working macros. All the function dealing with x,y have optional parameter specifying hotArea, play with it to determine the one you need.
I'm not sure about double-clicking event interception...Depends on your workflow with the macro, personally for a single-op. macros I prefer such procedure: hover a mouse over a shape, press a hotkey invoking the macro. And of course in my case the macro uses GetCursorPos winapi instead of GetUserClick. Code:
sub AddNode() dim x#, y#, shift&, sh as Shape, seg as Segment, offs&, N as Node If ActiveDocument.GetUserClick(x, y, shift, 10, True, cdrCursorWinCross) <> 0 Then Exit Sub with ActivePage.SelectShapesAtPoint(x, y, 0).Shapes if .Count=0 then exit sub set sh=.Item(.Count) end with if sh.IsOnShape(x,y)<>cdrOnMarginOfShape then exit sub set seg=FoundShape.Curve.FindSegmentAtPoint(x,y,Offs) set N=seg.AddNodeAt(Offs) |
#3
|
|||
|
|||
![]() Quote:
ok, double click is not needed in macro to do what I want to do, sorry. Where are you finding "FoundShape.Curve.FindSegmentAtPoint"??? I have looked through the Docs I have and find nothing like any of the 3 objects. As written "Offs" gives an error as argument, BTW. This is pretty much what I was looking for and coudn't find it. That appears to be my road block. Thanks for helping out. I appreciate it. |
#4
|
||||
|
||||
![]()
1. set seg=sh.Curve.FindSegmentAtPoint(x,y,Offs)
2. Offs must be declared as Double (Offs#) 3. I use F2 class browser and search within it Good luck :-) |
#5
|
|||
|
|||
![]()
Thanks. much better. I gather that FoundShape was defined elsewhere in your macro??? I still cant find it, in object browser, or anywhere...
I was looking everywhere (segment, subpath, node, etc) but not "curve" sheesh... Thanks Maybe I can leave you alone for a while.. Don |
#6
|
||||
|
||||
![]()
:-) FoundShape is a dummy name, I've changed it to sh which is my fave for such an object, yet missed that line when changing
|
![]() |
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 |
[DrawX3] RectangleFixer not working!!! | wOxxOm | Macros/Add-ons | 6 | 12-11-2007 12:41 |
Snap to Objects in Oberon ThreePointArc Macro | dgearl | CorelDRAW/Corel DESIGNER VBA | 3 | 05-09-2006 12:58 |
having to dbl click in X3 for tools to work | bloodgroove | General | 3 | 16-06-2006 13:46 |
Click and Drag Scaling similar to CAD applications | JSC | Feature requests/wishlist | 2 | 31-10-2005 11:27 |
Where is the selected text? | petig | CorelDRAW/Corel DESIGNER VBA | 7 | 16-05-2005 15:30 |