Friday, 29 July 2011

Skeeper - keep you selection (little macro)

In this post I would like to demonstrate a little macro which allows you to remember certain group of shapes without grouping them.

Skeeper



SKeeper creates groups of shapes/objects (not grouped shapes in CorelDraw meaning).
It put a registry to shape's name attribute (you can see it in Object Manager), when you click on the list with groups names it finds all shapes with the same record and adds them to selection.

Registry/records looks like this :    SK:groupName
where groupName will appear in the SKeeper list box

You can put anything in the object's name property, just keep SKeeper record at the end.

The limit is that the groups cannot overlap, in other words object can belong to only one group,
therefore if you try to assign object to group-2 which is already assigned to group-1 the first record will be replaced by second.

There is one thing I'd like to say about code, in this macro I use CQL (Corel Query Language) to search for shapes.
for example:
...
ActiveDocument.SelectableShapes.FindShapes(, , , "@name.Contains('SK:')")
...
 first 3 parameters are omitted (notice empty spaces between commas) and last parameter is a String type variable (notice quotes) and it represent the CQL syntax (very powerful tool).
See this article for more details:
Using CQL

Feel free to use this macro (in your company or home), look at the code if you like, leave comment, ask a question.

Gms file to download:
SKeeper.gms

You might be interested in more featured  similar macro, see:
http://www.oberonplace.com/products/selmgr

Tuesday, 12 July 2011

Selection tips

Object selection

To select or deselect objects you use Pick Tool.
To activate Pick Tool:

Click the icon on a toolbox:











Or hit Space-bar (if you are currently editing text hit Ctrl+ Space-bar).

The basic is that you get object.shape selected by clicking on it or drag mouse until desired object is surrounded by selection rectangle (blue dashed line).

To add/remove objects to/from the selection hold Shift.

While holding Alt key and dragging mouse the object(s) get selected/deselected if selection rectangle just cross it,
or when clicking can select objects being behind the clicked one.

Ctrl key makes selection rectangle a square,
or when clicking you can select objects within the group.

You can use any combination of modifier keys (Shift, Alt, Ctrl) to get desired effect.

When draging mouse to create selection press and hold Right Mouse Button before release Left one. You can now move the selection rectangle to different place.

You can use Object manager to select shapes as well.
On the main menu click window >> Dockers >> Object Manager  to open it.

This time it works like in a file manager ,
Hold Ctrl to add objects one by one.
Hold Shift key to add object between two selected.
This will not work within the grouped shape object.

Another way is to use Find Objects tool
Go to main menu >> Edit >> Find and Replace >> Find Objects...





















This is a tool to search for objects that have specified properties. Result of searching is selected object(s).
When there is selected object on screen the option "Find objects that match the currently selected object" become available.

With selected object on screen.


Without selected object.























Node selection


Selecting nodes is pretty much the same like selecting objects.
By clicking on it surround it with selection rectangle.
Shift & Ctrl modifier keys works the same.
Alt activate 'Freehand' mode, you compare it to something known from other graphic packages as 'lasso selection'




On the images above you can see that actually I haven't pressed Alt key but change selection mode in left-upper corner to Freehand. Holding Alt key give the same result.