OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 24-03-2011, 02:00
beczukdavid
Guest
 
Posts: n/a
Smile User input GUIDELINES

Hi, I have a question

Is there a macro out there that can do the following?

I have a line: lets say at 13 degrees. I want to be able to make a guide line based on 2 user inputs that will set the creation point of the guideline based on the first input, then set the center of rotation of that guide line based on the input. After the macro asks for the second input it creates the guide line from point A to point B with rotation relative from point A to point B.


Thanks.

David B.
Reply With Quote
  #2  
Old 24-03-2011, 06:48
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

HI.
It's probably to early but I don't understand completely.
Here's a sub that will create a guideline based on 2 clicks. Snap is enabled in the script.
You should be able to calculate an offset distance from the click points if needed.

Code:
Public Sub clickForGuide()
    Dim x1#, y1#, x2#, y2#, d#
    Dim Shift As Long
    Dim a As Boolean, b As Boolean
    Dim bSnap As Boolean

    
    If ActiveSelection.Shapes.count = 0 Then
    
        bSnap = True 'enable snap
        a = False
        b = False
        a = ActiveDocument.GetUserClick(x1, y1, Shift, 10, bSnap, cdrCursorEyeDrop)
        If Not a Then
            b = ActiveDocument.GetUserClick(x2, y2, Shift, 10, bSnap, cdrCursorEyeDrop)
        End If
        If Not b Then
            ActivePage.Layers(0).createGuide x1, y1, x2, y2
        End If
    End If
    
End Sub
-John
Reply With Quote
  #3  
Old 24-03-2011, 07:56
beczukdavid
Guest
 
Posts: n/a
Default

Thank you. I will test it out and let you know if its what I am looking for
Reply With Quote
  #4  
Old 24-03-2011, 07:59
beczukdavid
Guest
 
Posts: n/a
Default

PERFECT , Thanks
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
Document Center Guidelines PAnderson CorelDRAW/Corel DESIGNER VBA 11 15-01-2011 19:17
Select Guidelines macro kenpoist CorelDRAW/Corel DESIGNER VBA 5 05-01-2011 13:12
How do i print the guidelines? cristov General 3 26-02-2006 22:49
Snap to guidelines ddonnahoe CorelDRAW/Corel DESIGNER VBA 2 22-11-2004 12:21
CD11: Adding input from user form to document ddonnahoe Code Critique 2 09-04-2004 12:43


All times are GMT -5. The time now is 00:24.


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