OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 23-08-2012, 07:07
Joe Joe is offline
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe
Unhappy Findshapes() finds ghosts (from shapes with effects)?

Hi again!

Having a bit of a problem here with apparently non-existing shapes being added to a ShapeRange. The general use is more complex, but I have picked out a smaller portion for testing purposes.

To test it out you would create a shape with a, say, shadow effect and some other regular shapes, like rectangles. Then run this:

Sub PicksWhatItShouldnt()
    Dim SR As ShapeRange
    Dim S As Shape
    Set SR = ActivePage.Shapes.FindShapes()
    SR.RemoveRange SR.FindAnyOfType(cdrNoShape, cdrBitmapShape, cdrTextShape, cdrBlendGroupShape, cdrExtrudeGroupShape, _
    cdrOLEObjectShape, cdrContourGroupShape, cdrLinearDimensionShape, cdrBevelGroupShape, cdrDropShadowGroupShape, _
    cdr3DObjectShape, cdrArtisticMediaGroupShape, cdrConnectorShape, cdrMeshFillShape, cdrCustomShape, _
    cdrCustomEffectGroupShape, cdrSymbolShape, cdrHTMLFormObjectShape, cdrHTMLActiveObjectShape, cdrPerfectShape, cdrEPSShape)
    For Each S In SR
        If S.Outline.Type <> cdrNoOutline And S.Outline.Color.Name <> "None" Then
        End If
    Next S
End Sub
In theory it should just ignore the shadow bits and convert the outline of all the shapes, but in reality we get this:

Any ideas? The main goal here is to do something with the fill and outline of each and every shape that supports such actions.
Reply With Quote
Old 07-09-2012, 11:14
Joe Joe is offline
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe
Default Follow up

Alright, I managed to come up with a solution to this, that, while not too elegant still seems to function well. Use the power of .findshapes in small, controlled bursts, like this:

Dim SR As ShapeRange
Set SR = ActiveSelectionRange.Shapes.FindShapes(Type:="1", Recursive:=True)
SR.AddRange ActiveSelectionRange.Shapes.FindShapes(Type:="2", Recursive:=True)
SR.AddRange ActiveSelectionRange.Shapes.FindShapes(Type:="3", Recursive:=True)
SR.AddRange ActiveSelectionRange.Shapes.FindShapes(Type:="4", Recursive:=True)
SR.AddRange ActiveSelectionRange.Shapes.FindShapes(Type:="6", Recursive:=True)
It still digs into groups and such, but only picks the necessary shapes while avoiding programming anything recursive
Reply With Quote
Old 10-09-2012, 12:34
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811

I would try a cql query. I have fed some extremely large strings to CQL and it eats them well.
Reply With Quote


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
FindShapes & PowerClips ddonnahoe Macros/Add-ons 1 01-08-2012 17:45
about effects group... 3dvr CorelDRAW/Corel DESIGNER VBA 2 01-07-2009 15:06
FindShapes Selection irregularity Shaddy CorelDRAW/Corel DESIGNER VBA 2 18-07-2006 21:41
[VBA] FindShapes reduced behaviour in X3 ;-( wOxxOm CorelDRAW/Corel DESIGNER VBA 0 05-06-2006 11:50
[s.Effects.LensEffect] is Error hotswin CorelDRAW/Corel DESIGNER VBA 10 29-08-2005 03:00

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

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