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 20-09-2008, 03:36
admold
Guest
 
Posts: n/a
Default Replace object

Hi,
It is posible to replace an item (for example letter "e" but convert to curves, with fill cyan, no outlines) with the same object but with other properties (for example "e" with fill cyan outlines cyan 0.2mm?
That in a large group, who contains a lot of object, in which "e" appears in different positions but at the same size, without ungroup!

Rephrase - how can automatically select an item that appears multiple times in the file?

Adrian

Last edited by admold; 20-09-2008 at 05:19.
Reply With Quote
  #2  
Old 20-09-2008, 06:12
engandy
Guest
 
Posts: n/a
Default

Sub cyanAddcyanOutline()
Dim strColor As String
Dim p As Page
Dim sr As New ShapeRange

For Each p In ActiveDocument.Pages
sr.AddRange p.Shapes.FindShapes(Query:="@fill.color =cmyk(100,0,0,0)")
Next p

sr.SetOutlineProperties 0.2 / 25.4, , CreateCMYKColor(100, 0, 0, 0)
End Sub
Reply With Quote
  #3  
Old 20-09-2008, 07:59
admold
Guest
 
Posts: n/a
Default

Unfortunately we were unable to be more explicit.
I have a file that contains multiple objects (O1, O2, .. On ... Oi). These objects are each several times in this file. These objects are different but have the same color. I need to select all objects On (which can be rotated 90 or 180) to automatically change a property.

I thought a possible solution.
Suppose that the object appears only in May rotated 180. Means that H and W are the same for all objects on. It could make a selection after SizeWight and SizeHeight?

Adrian
I think it goes something like this
Sub selectare2()
Dim s As Shape
ActiveDocument.Unit = cdrMillimeter

For Each s In ActiveSelection.Shapes

If s.SizeHeight = 10.259 Then
If s.SizeWidth = 9.354 Then

ActiveDocument.CreateSelection
Else
End If
Else
End If
Next s
End Sub

Last edited by admold; 21-09-2008 at 04:08.
Reply With Quote
  #4  
Old 20-09-2008, 15:31
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,770
Blog Entries: 10
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 Cql

If you have X4, I would use CQL to do this. Couple of things first, this code assumes the shapes you are searching for are curves. If they are not, you will want to remove the node count check. I added to node count check just to make sure the shapes are the same.

The following code finds all the curve shapes that are the same color, original size and height, and have the same node count.

Original size is used because when you rotate the shape the size changes.
Code:
Sub SameShape()
    Dim s As Shape, p As Page
    Dim strColor As String
    Dim nodeCount As Long
    Dim w As Double, h As Double
    Dim sr As New ShapeRange
    
    Set s = ActiveShape 'Get Selected Shape
    strColor = s.Fill.UniformColor.ToString 'Get the fill color of shape
    w = s.OriginalWidth 'Get the original size, before rotation
    h = s.OriginalHeight
    nodeCount = s.Curve.Nodes.Count 'Number of nodes in shape
    
    For Each p In ActiveDocument.Pages
        sr.AddRange p.Shapes.FindShapes(Query:="@fill.color = '" & strColor & "' and @Com.OriginalWidth = '" & w & "' and " & _
                                               "@Com.OriginalHeight = '" & h & "' and @Com.Curve.Nodes.Count = '" & nodeCount & "'")
    Next p

    sr.SetOutlineProperties 0.2 / 25.4, , CreateCMYKColor(100, 0, 0, 0)
End Sub
Best of luck to you,

-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
Replace color admold CorelDRAW/Corel DESIGNER VBA 4 18-08-2008 18:04
Problems with replace knowbodynow CorelDRAW/Corel DESIGNER VBA 3 23-05-2008 19:19
Actual Replace vindaa CorelDRAW/Corel DESIGNER VBA 11 22-05-2008 20:20
Help with Replace Macro Pumpkin_Masher Macros/Add-ons 1 21-09-2005 14:41
Find/Replace with CorelDraw 9 and VB 6 sfldan CorelDRAW/Corel DESIGNER VBA 1 10-07-2003 17:44


All times are GMT -5. The time now is 23:03.


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