OberonPlace.com Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old 03-11-2008, 01:58
Joe Joe is offline
Member
 
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe
Default

Excellent, works like a charm! Thanks again! This will help with some other ideas as well.

It's pretty great to see how a couple of minutes here save hours of work in the future, gotta wonder why there aren't A LOT of macros floating around.

Quote:
Originally Posted by shelbym View Post
If you want to group your ActiveSelectionRange
-Shelby
I want to group the current object from the range with a rectangle which just got drawn around the current object, not the entire range. So it's a little trickier.

And yet more - How would I add a shape that was just duplicated to the current selection? So, for example, a rectangle gets a duplicate to the side of it and both of them end up selected. So that next time you could make a duplicate above them and all of that would be selected as well.

Last edited by Joe; 03-11-2008 at 02:03.
Reply With Quote
  #12  
Old 03-11-2008, 02:18
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,791
Blog Entries: 15
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Use ShapeRanges

The easiest way is to set your selection equal to a shaperange, then add your new duplicate shape to this shaperange and then create a selection.

Same for you group, just create a new shaperange and add the rectangle and current shape to it, then group it.

-Shelby
Reply With Quote
  #13  
Old 03-11-2008, 02:27
Joe Joe is offline
Member
 
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe
Default

I realized that that's the way to do it, but how to get to that just created duplicate or rectangle? Here's an example where a duplicate gets created to the right of the object (except for usability reasons I make the duplicate and then move the original so that it stays selected, but appears to be the copy).

Code:
Current.Duplicate 'How do I select this one to group with the Current one or add to the ActiveSelectionRange?
Current.Move Current.SizeWidth + Pad, 0
Edit: Ok, found a way to do it, seems to work alright:

Code:
Dim sr As New ShapeRange

For Each Current In ActiveSelectionRange
    sr.Add Current
    sr.Add Current.Duplicate
Next Current

sr.CreateSelection
But I keep having trouble when trying to add something that just got created, like:

Code:
For Each Current In ActiveSelectionRange
    Dim s As Shape
    Set s = ActiveLayer.CreateParagraphText(Current.LeftX + Pad, Current.TopY - Pad, Current.RightX - Pad, Current.BottomY + Pad, TextTemplate)
    sr.Add s 'This doesn't work - why?
Next Current

Last edited by Joe; 04-11-2008 at 03:14.
Reply With Quote
  #14  
Old 03-11-2008, 15:39
Joe Joe is offline
Member
 
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe
Default

Ok, having arrived at a certain point of completeness, decided to let the creation meet the world. So gonna attach the gms (well, zip, because of the board limitations) here, source visible and everything - I'm open to ideas on how to make things better or what could be added or improved.

So far I have tried to make a kinda-robust tool which helps with certain tasks which tend to pop up often - like splitting the page into sections, adding text, etc. It should also have all the proper Undo tags, etc. making it fast and after a little getting used to - easy to use.

And here's a quick rundown of the crazy mess of buttons that it is:



If you have CorelDraw X4 give it a try if you please and sure don't hold back if there's any suggestions. Thanks!

Edit: To give an idea, here are some things which take seconds to make using this:
Attached Files
File Type: zip MacrosByJoe.zip (41.4 KB, 13 views)

Last edited by Joe; 03-11-2008 at 15:45.
Reply With Quote
  #15  
Old 03-11-2008, 16:43
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,791
Blog Entries: 15
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Cool...

Nice work Joe, I will see if I can get some time tomorrow to look at it and give some suggestions. The one that comes to mind, you are using X4, it should be a docker. ;-)

-Shelby
Reply With Quote
  #16  
Old 03-11-2008, 16:56
Joe Joe is offline
Member
 
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe
Default

Thanks. Couldn't do it without the help given here and info found on this board.

Dockers always need switching, kinda like this one just flying around there and being on hand.

Also I really enjoy the relative simplicity of just editing VBA code and having it right there and then so gonna stick with it for a bit I guess.

Then again this is the first project, it still has a couple of options to add, but after that more things should come (together with learning to code better).
Reply With Quote
  #17  
Old 04-11-2008, 05:32
Joe Joe is offline
Member
 
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe
Default

Ok, now that selections are figured out added some extra features and, like seems to be the trend nowadays made a little video presentation of the template-making friendly rectangle functions. You can check it out here. Will try to make another one for the duplicator as well.

And attached is the latest version of the Toolbox.
Attached Files
File Type: zip MacrosByJoe.zip (28.4 KB, 19 views)
Reply With Quote
  #18  
Old 04-11-2008, 06:07
soydan
Guest
 
Posts: n/a
Default cool ...

thank you very much joe...
Reply With Quote
  #19  
Old 06-11-2008, 05:52
Joe Joe is offline
Member
 
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe
Smile Latest Additions

Ok, did some of my own thinking for a change, read up on help, learned to use the Debug mode properly (D'oh! Where was I before?) and added some new things (or in new ways).

Such as directional controls for most things, like the new My Selections panel for example: Click here to view a small video

And the selections are pretty simple for now, with no ability to save them inside the document. But I suspect that might be added as well.

In case someone's wondering why I'm making videos and such for a seemingly small thing that's mostly for myself - might use it for my studies (Should fetch a decent grade).

Edit: And thanks again for the heads up on Page.Properties, Shelby - managed to figure it out and rebuild the selections into proper ones. There are for per page as of now and each one gets saved together with the document and can be recalled later. Pretty cool, just what I wanted. The same functionality as Alex's Selection Manager, albeit limited to four slots I guess.

And noticed something while doing this - if I only do something with the properties to a freshly opened file Corel won't save anything when Saving and the selection data will be lost. Sort-of an unlikely event since if you would really work with the properties some other actions would also surely have taken place, but still an issue. Gotta think about making sure that Corel knows something has been done. Wonder if a BeginCommandGroup would help with this.

Anyhow, learned a lot while doing this, gonna implement some more crazy features real soon.

Last edited by Joe; 06-11-2008 at 13:25.
Reply With Quote
Reply

Tags
text


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
Select All Text On a Layer knowbodynow CorelDRAW/Corel DESIGNER VBA 2 24-05-2007 20:08
Dimension presets affect line endpoint default corel designer whiner Feature requests/wishlist 0 28-06-2006 13:17
Select specified text, change font size? fiddler2b CorelDRAW/Corel DESIGNER VBA 3 23-04-2006 08:11
Select Paragraph Text with more than one color joexx CorelDRAW/Corel DESIGNER VBA 2 06-10-2004 12:20
Select All ddonnahoe CorelDRAW/Corel DESIGNER VBA 4 10-02-2004 09:14


All times are GMT -5. The time now is 15:19.


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