Rotate more objects together with own center

Rotate more objects together with own center

Post by imagin » Mon, 21 Feb 2005 00:45:44


I have to edit (for example rotate) each selected object separately
with it's own center etc. It is included in Adobe Illustrator a it is
the only one feature I miss in Corel Draw 12.
Do you know how to resolve this problem?
 
 
 

Rotate more objects together with own center

Post by Unsubscrib » Mon, 21 Feb 2005 04:10:37


Can you clarify what you mean?

Are you trying to rotate more than 1 object at the same time while keeping
each one centered where they are?

Or are you trying to rotate more than 1 object at the same, as 1 object
(thereby changing the page position of all of them)?

Is there some other property you're trying to edit in all of them at the
same time?

(etc.)

- Brent

 
 
 

Rotate more objects together with own center

Post by imagin » Mon, 21 Feb 2005 10:44:09

I am sorry I do not have news reader installed, so I send this via
Google again and I have to set new thread ;o)

For example I have 1000 objects, and I want to rotate each of them
around its top left corner (and possibly move 1 mm to the left). First
object around his top left corner, second the same way around his top
left corner...

And I was wrong when I said I have Corel Draw 12, it is version 11!

Thank you, Imagino
 
 
 

Rotate more objects together with own center

Post by Bria » Mon, 21 Feb 2005 10:58:50


Hi Imagino,

I am struggling here to work out what you are asking. I cannot work out
if you want to select 1000 items and rotate them all at the same time,
or if you want to rotate them one at a time? If you could be a little
clearer as to what you are asking, I am certainly happy to try and help you.

Just for your info though, click an object in the desktop, then click it
again so that the "rotation" arrows appear. Then, the centre of the
object can be moved to the top left corner of the object. Any rotation
will then be around that top corner.

Brian.
 
 
 

Rotate more objects together with own center

Post by Peter Clif » Mon, 21 Feb 2005 16:18:57

Imagino spoke unto the group and said...
Yes it is possible.

But you have to do it in a VBA Macro, or CorelScript file.

Nick Wilkinson at www.isocalc.com in the cool tools section had a
wonderful VB utility called TransIt for older versions of Draw, it
replicated the Transform docker but applied the transformations
individually. Unfortunately it has not been updated to work in Draw 12
yet.

Alex Vakulenko at www.oberonplace.com as an old CorelScript file as part
of the Draw 9 MegaGallery suite that can be edited to run in Draw 12
that does a similar thing, it is called the Object Transform Script.

By default this script will work in Draw 9, but can be edited to run in
Draw 12, as CorelScript files are usually ASCII text you can search for
the string

CorelDRAW.Automation.9 and replace it with CorelDRAW.Automation.12

Or just for rotation, you could run this crude VBA macro on a selection
of objects in Draw 12.

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

Sub RotateObjects()

Dim s As Shape
Dim rotAngle As Double

rotAngle = CDbl(InputBox("Rotation Angle"))

If rotAngle <> 0 Then
For Each s In ActiveSelection.Shapes
s.Rotate (rotAngle)
Next
End If

End Sub

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

HTH

Peter
 
 
 

Rotate more objects together with own center

Post by Peter Clif » Mon, 21 Feb 2005 19:07:19

Imagino spoke unto the group and said...
This modified but still crude VBA macro will shift the shape to the left
1mm after rotation.

Tidied it up a bit to reset some things, if the original selection is
not too large it should undo with a single action.

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

Sub RotateObjects()

Dim s As Shape
Dim rotAngle As Double

Dim sx As Double, sy As Double, swidth As Double, sheight As Double

'preserve document settings
ActiveDocument.SaveSettings

'Ensure document is working in millimeters
ActiveDocument.Unit = cdrMillimeter

rotAngle = CDbl(InputBox("Rotation Angle"))

If rotAngle <> 0 Then

'Assign all operations to a single undo, may crash on a large selection
ActiveDocument.BeginCommandGroup RotateSelected

For Each s In ActiveSelection.Shapes

'Move rotation center to top left of object
s.GetBoundingBox sx, sy, swidth, sheight
s.RotationCenterX = sx
s.RotationCenterY = sy + sheight

s.Rotate (rotAngle)

'Move object 1mm left
s.Move -1, 0

'Reset rotation center to center of object
s.GetBoundingBox sx, sy, swidth, sheight
s.RotationCenterX = sx + (swidth / 2)
s.RotationCenterY = sy + (sheight / 2)

Next

'end group of commands
ActiveDocument.EndCommandGroup

End If

ActiveDocument.RestoreSettings

End Sub

-----------

HTH

Peter
 
 
 

Rotate more objects together with own center

Post by Bria » Mon, 21 Feb 2005 19:51:42


Please excuse my ignorance here Peter, how do you actually bring that
script into CorelDraw? Do you use the record docker window in some way?
I have never seen anyone use VBA in CorelDraw.

Brian.
 
 
 

Rotate more objects together with own center

Post by Bria » Mon, 21 Feb 2005 19:55:05


Please disregard that last message Peter. I was thinking of the scrip
docker in PP. I just realised there is a VBA toolbar in CorelDraw and I
would enter the code in there. All the best, Brian.
 
 
 

Rotate more objects together with own center

Post by imagin » Mon, 21 Feb 2005 22:50:29

I hope I will not start new thread again...

Peter Clifton> TransIt looks good, but I cannot run it under Draw 11.
But it's help file says:
========================
This script will only work with CorelDRAW versions 7, 8, 9 and 9
Office Edition. The same script is used for all four versions. This
script is manually installed and uninstalled.
To install the script in any version of CorelDRAW do the following:
1. Copy the file "??? Launcher.csc" to the Scripts folder of your
version of CorelDRAW.
2. Start CorelDRAW, right-click on a button bar and choose Customize.
3. Now, locate the Launcher script in the treeview and click on it.
Now, in the right-hand part of the dialog, drag the words "???
Launcher.csc" onto a button bar. You can create a new button bar if
you want to -- see CorelDRAW's online documentation.
4. Now, in Windows Explorer, double-click on the "??? Launcher CDR
Icon.bmp" file, which will open it in MSPaint.
5. Select all (CTRL-A) and copy (CTRL-C).
6. Back in CorelDRAW, right click on the script button and choose
Properties.
7. Right click on the large icon and choose Paste.
8. Click OK and then OK again and that's that.
========================

So it look like it is possible, but I cannot get this script into Draw
11 any way. In the subparagraph number 2 -> I caannot do exactly that.
Subparagraph number 3 -> I cannot find anything like that, I can use
only pre-maid buttons.

Do you know how to do that?

Then, i tried to edit CorelScript from Oberonplace, but poorly.
I am really stupid at VBA, could you help me with that, please?


Anyway, your script is doing exactly what I need! But if it is
possible to run scripts mentioned above, it will be much better.

I am looking for method how to run (your) sript via (assignable)
keyboard shorcut, but I am unsuccesfull. Is it possible?

Than you VERY MUCH for your help, it worthy!



Brian> As you can see above, you are now clear in what I need. Thank
you.
 
 
 

Rotate more objects together with own center

Post by Frantisek » Mon, 21 Feb 2005 23:25:45

OK, now I really have the newsreader ;o)

Peter, I studied your last script and I think I understand everything.
It is good commented, I could now change some "variables" and it will
do what I need.

But I am still looking for working version of "TransIt" or Oberon's
"Object Transform Script".

Do you have them working in Draw version 11/12?

Thank you, you are my life-saviour!

--
Imagino
 
 
 

Rotate more objects together with own center

Post by Frantisek » Mon, 28 Feb 2005 18:18:49

>------------

Now I finished tests, it good script, but works very slow on a lot of
object (thousands), tens of minutes on my Celeron 2,66 GHz and 1 GB
RAM. Is there any way to speeed up this?

Thank you for answer.

Imagino
 
 
 

Rotate more objects together with own center

Post by ah » Tue, 01 Mar 2005 05:51:54


I ran it on 5,000 1mm squares with a P4 2.8E (1MB-L2) 1GB RAM. . . it took over
three hours to parse them all ;-)
--
ah