OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 23-12-2005, 12:51
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
Join Date: Mar 2005
Posts: 836
Default ::ForEach:: macro

Very useful macro:
1. do some transform to one object (any repeatable with CtrlR transform)
2. select any number of other objects and run this macro and all these objects will be transformed individually

Sub ForEach()
   Dim sr As ShapeRange, s As Shape, stat As AppStatus
   Set sr = ActiveSelectionRange: cnt = sr.Count: i = 1
   Optimization = True
   EventsEnabled = False
   ActiveDocument.PreserveSelection = False
   On Error Resume Next
   Set stat = Application.Status: stat.BeginProgress CanAbort:=True
   For Each s In sr
      If s.Selectable Then s.CreateSelection: ActiveDocument.Repeat
      i = i + 1: stat.Progress = i / cnt * 100
      stat.SetProgressMessage "Repeating..." & Str(i) & " / " & Str(reps)
      If stat.Aborted Then MsgBox "Command repeated " & Str(i) & " times": Exit For
   EventsEnabled = True
   Optimization = False
End Sub
P.S. i never use 'option explicit' so be careful ;-)

Last edited by wOxxOm; 26-12-2005 at 11:06.
Reply With Quote
Old 24-02-2006, 16:27
Posts: n/a
Default good work

congratulations, this is good without opt.exp.
Reply With Quote
Old 08-12-2010, 15:12
Posts: n/a
Question Resize / transform macro problem (will pay for fix)

I'm a big fan of macros (bought Woxxom pkg @ macromonster), but I am having issues with what should be a simple matter.

I do circuit boards. I need to laser out paste masks to go on the boards, so I take a PDF of the little pads that need paste and laser them out. Trouble is, I often need to scale all the pads down a bit (90~95%).

I was thrilled to find the "repeat tranform" macro, and it seems to be exactly what I need. Except CorelDraw doesn't behave properly with the "repeat transform" feature.

Most pads are simple 4-node curves rectangles, in zero & 90 degree orientations. When I take a "fat" one and apply a 95% scale to the X&Y, it looks right. When I re-apply (ctrl-R) that transform to a thin pad (90 degrees from the "fat" one), it applies the mathematical size change of the first (say, from 1mm to 0.9mm in X direction), not the percentage ratio change of the selected item.

I'll pay for for coding similar macro that fixes this bug.


Here's a pic showing the issue:

<a href="http://www.flickr.com/photos/solarbotics/5244248679/" title="CorelDraw problem by Solarbotics, on Flickr"><img src="http://farm6.static.flickr.com/5282/5244248679_a028b54be9_o.png" width="705" height="2609" alt="CorelDraw problem" /></a>
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
Cannot use Curveworks macros in a user witten macro??? jon46089 CurveWorks 2 02-03-2006 15:18
Help with Replace Macro Pumpkin_Masher Macros/Add-ons 1 21-09-2005 15:41
An Idea for a handy and easy to make macro vallentin Macros/Add-ons 2 16-03-2004 12:35
New macro to clip curves w.r.t. a border Gerard Hermans Macros/Add-ons 0 09-06-2003 08:50
Speeding up a macro Rick Randall CorelDRAW/Corel DESIGNER VBA 2 12-12-2002 11:51

All times are GMT -5. The time now is 05:57.

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