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 18-03-2009, 10:34
bprice's Avatar
bprice bprice is offline
Member
 
Join Date: Oct 2006
Location: Edmundston, New Brunswick, Canada
Posts: 89
Default Name Seperated Object

Hey Everyone!

Quick question...

I draw a box and do this...

Code:
S.CreateContour(cdrContourInside, 1, 1, cdrDirectFountainFillBlend).Separate
When I do this, the active selection comes back to, or is still on, my originally selected square...

BUT... what I'd like to do is name the square created by the contour... or name the seperated object... after it has been seperated...

How would I do this?

Thanks in Advance,
B
Reply With Quote
  #2  
Old 18-03-2009, 12:37
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,790
Blog Entries: 13
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 Naming Contour

Wasn't sure what you meant by naming....but here is my attempt.
Code:
Sub NamingContour()
    Dim s As Shape
    Dim sContour As Shape
    
    Set s = ActiveShape

    Set sContour = s.CreateContour(cdrContourInside, 1, 1, cdrDirectFountainFillBlend).Separate(1)
    
    sContour.Name = "MyContour"
End Sub
Best of luck,

-Shelby
Reply With Quote
  #3  
Old 19-03-2009, 07:17
bprice's Avatar
bprice bprice is offline
Member
 
Join Date: Oct 2006
Location: Edmundston, New Brunswick, Canada
Posts: 89
Default Nice! One question though...

As usual... works like a charm and it's exactly what I needed... thank you muchly!

But... I'm curious... what does the (1) achieve or signify after the
Code:
.Seperate(1)
code?

B
Reply With Quote
  #4  
Old 19-03-2009, 23:30
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,790
Blog Entries: 13
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 .Seperate(1)

the (1) is the index of the shape I want to return. This way I know I am only getting wanted contour.

-Shelby
Reply With Quote
  #5  
Old 19-03-2009, 23:36
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default

Contour.Separate returns a range of shapes which used to comprise the contour. Shelby's code is essentially this:

Code:
Sub NamingContour()
    Dim s As Shape
    Dim sContour As Shape
    Dim sr As ShapeRange    
    Set s = ActiveShape

    Set sr = s.CreateContour(cdrContourInside, 1, 1, cdrDirectFountainFillBlend).Separate
    Set sContour  = sr(1)
    
    sContour.Name = "MyContour"
End Sub
Reply With Quote
  #6  
Old 20-03-2009, 06:54
bprice's Avatar
bprice bprice is offline
Member
 
Join Date: Oct 2006
Location: Edmundston, New Brunswick, Canada
Posts: 89
Default

very interesting! I'm still learning all this stuff! I'm getting better... but still picking up stuff along the way! I appreciate the info and the help guys!

B
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
Positionin few object to few object VaaL2004 CorelDRAW/Corel DESIGNER VBA 1 10-10-2008 02:18
How to select object inside another object jukos General 4 24-10-2005 22:27


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


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