OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 29-01-2010, 12:57
goisender
Guest
 
Posts: n/a
Default Artistic Media Group Issue

Hi Masters,

This's a issue about a simple macro that i'm creating for separate artistic media group object from path.

-------------------
The code is:

Sub ClearPath()
For Each s In ActiveSelection.Shapes.FindShapes(,cdrArtisticMediaGroupShape)
s.Selected = True
s.Separate
s.Previous(cdrLevelGroup, True).Delete
s.Selected = False
Next s
End Sub

-------------------

In corel Draw X4, release 14.0.0.567 works fine but when launch this macro over 14.0.0.701 softwre crash, closes master window without any error message. Would you help me about this.

Thanks a lot.
Reply With Quote
  #2  
Old 30-01-2010, 10:26
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Where you trying to delete the line after.
If so maybe this will work for you.

Code:
Sub ClearPath()
Dim s As Shape
    For Each s In ActiveSelection.Shapes.FindShapes(, cdrArtisticMediaGroupShape)
    s.Separate
    ActiveSelection.Delete
    Next s
End Sub
-John
Reply With Quote
  #3  
Old 01-02-2010, 12:44
goisender
Guest
 
Posts: n/a
Default

Hi John,

Thanks so much for your idea.

This action:

'activeselection.delete'

delete all shapes (artistic media group shape) but i only want delete path. Keeping Artistic media group as a group of shapes without change any more.

In my code, the line:

's.Previous(cdrLevelGroup, True).Delete'

Delete only the path. This code works fine without problem except in sp2 of corel draw x4, release 14.0.0.701. this's the extrange issue. i can't find a solution, yet.
Reply With Quote
  #4  
Old 02-02-2010, 10:10
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hmm....That's weird.
On my machine it deleted only the path and left the artistic media.
After separating it left the path as the active selection and I deleted that.
I'll re check....

-John
Reply With Quote
  #5  
Old 02-02-2010, 10:13
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

I tested my code on only 1 path with artistic media applied to it.

Are you using many artistic media shapes and you want to separate and delete paths from all?

If so we should have to use a shaperange instead of activeselection.
-John
Reply With Quote
  #6  
Old 02-02-2010, 10:45
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Here's one way to do it with multiple artistic media shapes on the page:

Code:
Sub ClearPath()
Dim s As Shape
Dim sr As ShapeRange, sr2 As New ShapeRange

Set sr = ActiveSelectionRange

For Each s In sr
    If s.Type = cdrArtisticMediaGroupShape Then
        s.CreateSelection
        ActiveSelection.Separate
        ActiveDocument.ClearSelection
    Else
        sr2.Add s
    End If
Next s

sr2.Delete

End Sub
-John
Reply With Quote
  #7  
Old 06-02-2010, 10:07
fungel
Guest
 
Posts: n/a
Default Crash after using the macro

Hi John,

Your macro works great but then when i click on the new shape created (artistic media tool) then corel crashes. I'm using CorelDrawX4 with all up to date patches. Could it be i need to either A) refresh the screen after the macro or B) do a memory dump to clear everything that happened in the macro?

I would not know how to do either of the above so any help is appreciated.


Fungel
Reply With Quote
  #8  
Old 06-02-2010, 10:45
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Can you attach the file your working with. I'm unable to replicate that. Mine doesn't crash after.
-John
Reply With Quote
  #9  
Old 07-02-2010, 14:35
goisender
Guest
 
Posts: n/a
Default Artistic Media Group Issue

Hi John,

Finaly i found the way to get it, of course with your invaluable contribution. This's my idea; Add all cdrcurveshapes with no-fill and no-outline in a shaperange before separate, separate artisticmediashapes and then delete all shapes in shaperage created before and with no-fill and outline different from no-outline.
I used this way because there're other shapes in the page or perhaps in activeselection.
I'm not very pleased with this way because it's possible an artistic media path created with basic shapes (ellipse, rectangles...) and user can try to fill the path and not undo this action 'cos is open shape and is not visible.
I appreciate your opinion, i would like to know what you think about.

Thanks.
Reply With Quote
  #10  
Old 07-02-2010, 18:59
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Smile

Hi,
I'm sorry. I just not understanding exactly what you needed to do.

I tested the code on all types of shapes (filled or not, outline or not, curve, open and closed path) and it seems to work perfect. It separates the artistic media group and deletes curves. It only works in selections and if it is an artistic media group shape.

Could it be the brush you're using that's causing the error?

-John
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
PhotoPaint X4 "Artistic Media" backuping solution lebaron General 0 19-08-2009 05:20
Find Group ungroup it then process and again group derasje Macros/Add-ons 2 19-11-2008 04:04
Artistic Media Groups And VBA knowbodynow CorelDRAW/Corel DESIGNER VBA 2 08-05-2008 22:18
Eraser issue jahmer General 0 17-01-2008 15:59
Change brush in Artistic Media Tool dizzzy Macros/Add-ons 1 23-06-2007 09:21


All times are GMT -5. The time now is 18:33.


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