View Single Post
  #3  
Old 13-12-2007, 16:16
flyer
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by wOxxOm View Post
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)

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