OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 19-02-2010, 15:31
L_G_D L_G_D is offline
Join Date: Apr 2009
Posts: 31
Default Adding control objects after breaking apart blend

I've got a macro that creates a couple of objects and blends them. That bit works fine. Then, after the blend is done, I want to break it apart, select the original control objects and the blended objects, duplicate them, move them, and change their attributes. I have everything working except the part where it selects the original control objects, tried everything I know, but can't seem to get it to work. Here's the releveant code, snipped from a larger macro:

    Dim crv As Curve, crv1 As Curve, crv2 As Curve, crv3 As Curve, crv4 As Curve
    Dim sh As Shape, sh1 As Shape, sh2 As Shape, sh3 As Shape, sh4 As Shape
    Dim sp1 As SubPath, sp2 As SubPath, sp3 As SubPath, sp4 As SubPath
    Dim BBSetOff As Double, Thick As Double, eff1 As Effect, eff2 As Effect
        Set crv1 = CreateCurve(ActiveDocument)
        Set crv2 = CreateCurve(ActiveDocument)
        Set crv3 = CreateCurve(ActiveDocument)
        Set crv4 = CreateCurve(ActiveDocument)
            Set sp1 = crv1.CreateSubPath(bbx + width - 0.125, bby + height + BBSetOff - 0.04)
                sp1.AppendLineSegment bbx + width - 0.125, bby + height + BBSetOff + 0.04, False
            Set sh1 = ActiveLayer.CreateCurve(crv1)
                sh1.Outline.SetProperties 0.02
                sh1.Outline.Color.CMYKAssign 0, 0, 0, 0
            Set sp2 = crv2.CreateSubPath(bbx + 0.125, bby + height + BBSetOff - 0.04)
                sp2.AppendLineSegment bbx + 0.125, bby + height + BBSetOff + 0.04, False
            Set sh2 = ActiveLayer.CreateCurve(crv2)
                sh2.Outline.SetProperties 0.02
                sh2.Outline.Color.CMYKAssign 0, 0, 0, 0
            Set eff1 = sh1.CreateBlend(sh2, width / 0.4)
                ' ActiveSelection.AddToSelection (sh1)
                ActiveSelection.Move 0, 0.08
                ActiveSelection.Outline.SetProperties 0.008
As you can see, I have
ActiveSelection.AddToSelection (sh1)
in there, and that's the bit that's giving me errors about missing parameters or mismatched functions, so I'm obviously using it wrong, or it doesn't like the fact that I'm trying to add to an active selection, or something.

Once the blend is broken apart, it's the active selection, and I can do everything else to it except add sh1 and sh2 to the selection so they are included in the new transformations.

Any ideas? Thanks.
Reply With Quote
Old 19-02-2010, 16:16
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811

You could try:

if activeselection.count = 0 then




end if
Sorry. It's untested, but I gotta go to work and don't have much time. Be back later.

Reply With Quote
Old 22-02-2010, 09:24
L_G_D L_G_D is offline
Join Date: Apr 2009
Posts: 31

Thanks, that was it:

As usual, I was going about it backwards by starting at the current selection instead of the object I wanted to add.
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
Breaking a curve and separating madhur General 4 22-09-2007 19:53
Needed macro for BLEND properties ?? soydan CorelDRAW/Corel DESIGNER VBA 2 21-05-2007 12:07
blend splitting problem. Solution wOxxOm CorelDRAW/Corel DESIGNER VBA 0 23-08-2005 12:46
breaking object at corners toy4mud CorelDRAW CS 1 09-04-2005 22:12
... Non breaking Space ... Hernán General 5 06-01-2005 06:03

All times are GMT -5. The time now is 02:07.

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