I have CorelDraw X6 and in all my projects I have a number of objects that are deliberately hidden (by setting the outline to NONE (this also, for some reason, turns the colour off).
In some uses of these projects I need to turn the hidden objects back on (or even delete them) but because they have no outline (they are curves) and no colour I am having difficulty actually 'finding' them in a MACRO search.
I can't use multiples layers because (AFAIK) CorelDraw won't let you have a group of objects across multiple layers. To explain, I am creating front panel designs for electronic modules and these designs include 'components' which are a collection of objects. Some of these objects re permanently enabled and form the visual display of the component while other objects are hidden and form background details such as hidden body outlines or hole cut-outs in the panel. To assist with moving the component as a single item and being able to place it accurately, I have a large circle which completely encloses the component which I call 'Group'. For 99.9% of its' life it remains hidden. Because the 'Group' is large (the centre of this 'Group' circle coincides with the centre point of the component) they extend well beyond the boundary of the front panel outline. I now need to place multiple panel designs on a single sheet and plan to use a Document Grid to assist with snapping each panel to a position within the sheet without having to manipulate its position by playing with its X/Y co-ordinates. As such, I need to run a MACRO on all of the items on the sheet and 'DELETE' these hidden objects but I can't find how to 'find' these obejcts to hide them. I have macros that work on visible items but these are eluding me.
Your "hidden" objects have no outline & no fill. You can browse through all objects on page to find objects without outline and delete them
Sub Delete() Dim SR As ShapeRange ActiveDocument.BeginCommandGroup ("delete") Set SR = ActivePage.Shapes.All SR.UngroupAll For Each sn In SR If sn.Outline.Type = cdrNoOutline Then sn.Delete Next sn ActiveDocument.EndCommandGroupEnd Sub
You're welcome. Another way
Sub Delete1() Dim SR As ShapeRange, sh As ShapeRange ActiveDocument.BeginCommandGroup ("delete1") Set SR = ActivePage.Shapes.All SR.UngroupAll Set sh = ActivePage.Shapes.FindShapes(Query:="@outline.type='none'") sh.Delete ActiveDocument.EndCommandGroupEnd Sub