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 26-01-2012, 21:26
gorgo gorgo is offline
Senior Member
 
Join Date: Feb 2010
Posts: 169
Default line arrow endpoint select same

What would the code be to search for the same arrow styles of lines on a page?
Reply With Quote
  #2  
Old 27-01-2012, 00:05
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,778
Blog Entries: 11
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Arrow

Oh you had to know I would bust out the CQL for this one. :-)
Code:
Sub FindMyArrow()
    Dim sr As ShapeRange
    
    Set sr = ActivePage.Shapes.FindShapes( _
         Query:="@com.outline[.startarrow.index = 3 or .endarrow.index = 3]")
            
    sr.CreateSelection
End Sub
This will find the shape that has the arrow at the start or end, if you wanted it to be both, just change to an and instead of the or.

-Shelby
Reply With Quote
  #3  
Old 28-01-2012, 15:28
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Quote:
Originally Posted by shelbym View Post
Oh you had to know I would bust out the CQL

-Shelby
...You are the CQL Guru!
~John
Reply With Quote
  #4  
Old 29-01-2012, 10:24
gorgo2 gorgo2 is offline
Senior Member
 
Join Date: Feb 2010
Posts: 107
Default

Quote:
Originally Posted by shelbym View Post
Oh you had to know I would bust out the CQL for this one. :-)
Code:
Sub FindMyArrow()
    Dim sr As ShapeRange
    
    Set sr = ActivePage.Shapes.FindShapes( _
         Query:="@com.outline[.startarrow.index = 3 or .endarrow.index = 3]")
            
    sr.CreateSelection
End Sub
This will find the shape that has the arrow at the start or end, if you wanted it to be both, just change to an and instead of the or.

-Shelby
Thanks Shelby. However nothing happens when I run the code while a line with an arrow is selected and I did not see the other lines with the same arrow end get selected. Did I miss something?
__________________
Using: CorelDraw X4 (14.0.0.701)
OS: Windows XP Pro
Reply With Quote
  #5  
Old 29-01-2012, 13:14
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,778
Blog Entries: 11
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Arrow

This code does not get the arrow type of the current selection. It simply selects all shapes that have the arrow type of 3 on the start or end.

You would need to modify the code to get the arrow type of the current selection if that is how you would like it to work. :-)

Something like this:
Code:
Sub FindMyArrow()
    Dim sr As ShapeRange
    Dim lngStartArrow As Long, lngEndArrow As Long
    
    lngStartArrow = ActiveShape.Outline.StartArrow.Index
    lngEndArrow = ActiveShape.Outline.EndArrow.Index
    
    Set sr = ActivePage.Shapes.FindShapes( _
         Query:="@com.outline[.startarrow.index = " & lngStartArrow & " and .endarrow.index = " & lngEndArrow & "]")
            
    sr.CreateSelection
End Sub
This will select all other shapes that have the same start and end arrow type as the currently selected shape.

-Shelby

Last edited by shelbym; 29-01-2012 at 14:11.
Reply With Quote
  #6  
Old 29-01-2012, 21:57
gorgo gorgo is offline
Senior Member
 
Join Date: Feb 2010
Posts: 169
Talking

Brilliant. Well done Shelby!
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
Incorrect distribution of the arrow on the open curve ajesion Macros/Add-ons 8 05-05-2011 10:21
Dimension presets affect line endpoint default corel designer whiner Feature requests/wishlist 0 28-06-2006 13:17
Creating custom arrow heads Alex FAQ 1 27-04-2005 16:05
Length of line pragatipc SecuriDesign 1 18-08-2004 20:23
I can't let the text on a curve line Dino CorelDRAW/Corel DESIGNER VBA 2 11-04-2003 04:13


All times are GMT -5. The time now is 18:11.


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