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 17-10-2005, 08:26
ivelink
Guest
 
Posts: n/a
Default remember the position of a group

Hi,

i have 5 groups of objects that i always (50 times a day) need to rearange from Stage 1 to Stage 2
2 and vice versa.
Is it possible to remember the (Stage 1) position of each of the groups even afrer i modify them (add, remove, reshape objects from the group)and
when is needed to go back to Stage 1 ?
Please help me,
Thank you
Attached Images
 

Last edited by ivelink; 17-10-2005 at 11:29.
Reply With Quote
  #2  
Old 17-10-2005, 10:24
Shaddy
Guest
 
Posts: n/a
Default

Sounds like Stage 1 is a template that you start with. Couldn't you open up the Stage 1 file, make your changes, then instead of Saving, you use Save As. That way, Stage 1 will always be the same for you to open and use as your starting point.

If that won't work, maybe you could make your Stage 1 as a sep Layer, then you could always lock it and make it invisible until you need it later. You copy it to a working layer that you alter, when it's time to start over, you delete the working layer and copy a new fresh layer based on the Stage 1 Layer and start over.

Just throwing some ideas around

Shaddy
Reply With Quote
  #3  
Old 17-10-2005, 11:10
ivelink
Guest
 
Posts: n/a
Default

no this is about the position of this pannels
Reply With Quote
  #4  
Old 17-10-2005, 11:11
ivelink
Guest
 
Posts: n/a
Default

no this is about the position of each pannels.
Reply With Quote
  #5  
Old 17-10-2005, 16:06
petig
Guest
 
Posts: n/a
Default

I'm not clearly understand what for, but I think anything about. The groups, like any shape, have a property named Properties, where you can store any custom data visible and handle through macros only, and query back later. With use of this you may write two separate macros (or a combined one with any userform), one for storing the actual position with group or shape, and another to query the Properties content to do something with. The only problem, if you ungroup a group, its custom data will be lost, even if you group again. (The groups looks like shapes. Them properties, e.g. StaticID, remain while they "live".) Ok, too much blabla. Examples:

Code:
Sub StorePosition()
   ActiveShape.Properties("OrigPos", 1) = ActiveShape.PositionX
   ActiveShape.Properties("OrigPos", 2) = ActiveShape.PositionY
End Sub

Sub RestorePosition()
   If ActiveShape.Properties("OrigPos", 1) <> "" Then
      ActiveShape.PositionX = ActiveShape.Properties("OrigPos", 1)
      ActiveShape.PositionY = ActiveShape.Properties("OrigPos", 2)
   Else
      MsgBox "Position not stored yet", vbExclamation, "Restore position"
   End If
End Sub
In the example above you may use any criteria when you store/restore any data, or may add code (or make a third macro) to automaticaly store data for all of a special kind of shapes, e.g. groups. Something like this:

Code:
Sub StoreGroupsPosition()

Dim s As Shape

For Each s In ActivePage.Shapes
   If s.Type = cdrGroupShape Then
      s.Properties("OrigPos", 1) = s.PositionX
      s.Properties("OrigPos", 2) = s.PositionY
   End If
Next
   
End Sub
Note that, what you get or set with position properties depends on the document's actual referencepoint. If it changes, the stored data will reference the same position, but another point of the group. To avoid that you may store and set back the referencepoint on the same way. However, what you mean, to add a shape to a group, and than restore its "original" position is an intresting problem. While the added shape doesn't change the group's boundings (it is "inside"), its ok. But, if change occur, then the restoration is depends on which point of group you stored, and which relation it has with the change...
Reply With Quote
  #6  
Old 17-10-2005, 16:13
petig
Guest
 
Posts: n/a
Exclamation

Ah, exuse me, I forgot. Third problem is if the origin point of the document has change (e.g. you move the rulers corner with mouse), then the similar effect happen... Avoid the same way, so may store .Properties("OrigPos", n) , where n = 0, 1, 2, 3, 4, ...
Reply With Quote
  #7  
Old 18-10-2005, 07:18
ivelink
Guest
 
Posts: n/a
Default

Thank you very much Petig
What if i use only powerclips.
This is an option for me
Reply With Quote
  #8  
Old 18-10-2005, 09:14
petig
Guest
 
Posts: n/a
Default

Makes me glad, if it helps.
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
Position inch to mm GoodLook CorelDRAW/Corel DESIGNER VBA 2 11-11-2008 00:47
Relative position with group RichT CorelDRAW/Corel DESIGNER VBA 12 19-10-2005 15:15
Create a Group shelbym CorelDRAW/Corel DESIGNER VBA 1 18-03-2004 19:12
Need help accessing objects in a group ama CorelDRAW/Corel DESIGNER VBA 5 20-02-2004 11:28
Getting the mouse position Rick Randall CorelDRAW/Corel DESIGNER VBA 1 04-12-2002 09:29


All times are GMT -5. The time now is 09:36.


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