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 06-11-2009, 19:44
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 431
Default Problem with Intersect and outlines CD12

Hello,

I have this code to automate cutting an object into pieces:

Code:
Sub autoIntersectAndTrim()

Dim target As Shape, cutter As Shape, source As Shape

Set source = ActiveSelection.Shapes(1)
Set cutter = ActiveSelection.Shapes(2)

Set target = cutter.Intersect(source, False, True)
source.AddToSelection

Set target = target.Trim(source, True, False)

ActiveDocument.ClearSelection

End Sub
The problem is if I run it on an object that contains outlines it hangs. The strange thing is if I do intersect manually there is no problem. Using Draw 12 how can I automate the process so that the target object is cut into pieces and the object used for cutting is removed?

Thanks,

Chris
Reply With Quote
  #2  
Old 06-11-2009, 20:12
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

I always leave the parameters on trim and intersect set to true and delete later.

like:

Code:
Sub autoIntersectAndTrim()

Dim target As Shape, cutter As Shape, source As Shape

Set source = ActiveSelection.Shapes(1)
Set cutter = ActiveSelection.Shapes(2)

Set target = cutter.Intersect(source, True, True)
cutter.Delete
source.Delete

ActiveDocument.ClearSelection

End Sub
or

Code:
Sub autoIntersectAndTrim()

Dim target As Shape, cutter As Shape, source As Shape

Set source = ActiveSelection.Shapes(1)
Set cutter = ActiveSelection.Shapes(2)

Set target = cutter.Trim(source, True, True)
cutter.Delete
source.Delete

ActiveDocument.ClearSelection

End Sub
Reply With Quote
  #3  
Old 06-11-2009, 20:50
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 431
Default

Thanks, I already tested and the parameters don't make a difference. I still hangs.
Reply With Quote
  #4  
Old 06-11-2009, 21:07
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

hmm...weird
I tested on cdr12 and works fine.

The params were crashing my x4 so now I always set to true.

-John
Reply With Quote
  #5  
Old 06-11-2009, 22:22
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 431
Default

Thanks, I double-checked my code using your idea and this code works in CD12:

Code:
Sub autoIntersectAndTrim()

Dim target As Shape, cutter As Shape, source As Shape

Set source = ActiveSelection.Shapes(1)
Set cutter = ActiveSelection.Shapes(2)

Set target = cutter.Intersect(source, True, True)

cutter.Trim source, True, True

cutter.Delete
source.Delete

ActiveDocument.ClearSelection

End Sub
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
Problem with Outlines knowbodynow CorelDRAW/Corel DESIGNER VBA 4 24-05-2008 20:36
CD12 Thumbnailer chrstn CorelDRAW/Corel DESIGNER VBA 1 17-10-2005 09:19
why looks print from AI9 another then from CD12 rudyj.zabijak CorelDRAW/Corel DESIGNER VBA 2 09-04-2005 15:10
CD12: Dialogbox joexx CorelDRAW/Corel DESIGNER VBA 4 04-03-2004 07:08
Intersect / Getpixelcolor adriano Corel Photo-Paint VBA 1 15-04-2003 10:07


All times are GMT -5. The time now is 04:29.


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