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 02-02-2010, 21:14
andrewf
Guest
 
Posts: n/a
Default hiding/showing single shapes

Is there a property or method (I can't find one documented) to hide or et visible = false on a shape ?
I am working on a project to automate the manipulation of a corel draw document. The client has provided a corel draw file which contains a "superset" of shapes, i.e. all the shapes, text, etc. that could possibly be used.
My macro will read in a text file containing instructions and values and manipulate the shapes accordingly.
One of the first steps is to "hide all", and then selectively show (resize, move, fill, colour etc.) various shapes according to the data read in by the macro.

Any help greatly appreciated.
Reply With Quote
  #2  
Old 02-02-2010, 21:28
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.

You could always use cut, or copy to clipboard, the shapes you need to hide at the moment. Then paste back at anytime. Assigning to a form button for example, for cutting the desired shape. If cutting again then paste back first before re - cutting.

confusing?

-John
Reply With Quote
  #3  
Old 02-02-2010, 22:35
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,787
Blog Entries: 11
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 Hide Layer

I think I would create a new Layer, move all the shapes to this layer, then hide the layer.

-Shelby
Reply With Quote
  #4  
Old 03-02-2010, 00:10
andrewf
Guest
 
Posts: n/a
Default

Thanks All.

I think the new layer is the way to go, as I need to hide all shapes initially, and then selectively make some visible as well as perform other manipulations.

This needs to run completely unattended (on a server), and not knowing how many shapes I have to deal with in advance makes me more than a bit nervous relying on the clipboard.

As I have very little control (at this point) over the starting document, I assume I will need to determine how many layers are present (or can I just create a new one and have the layer number/Id returned ?)
Reply With Quote
  #5  
Old 03-02-2010, 00:35
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,787
Blog Entries: 11
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 Layer

You can name the Layer was ever you like. I would make it something rather random so their would not be a duplicate.

-Shelby
Reply With Quote
  #6  
Old 03-02-2010, 00:38
andrewf
Guest
 
Posts: n/a
Default New Layer

Thanks, now for the confession.

I am a newbie to CorelDraw (and only vaguely familiar with VBA).

How do I create a new layer ?

The documentation I have suggests there is a LayerCreate method available to the Document class, but this doesn't seem to be available.
Reply With Quote
  #7  
Old 03-02-2010, 00:40
andrewf
Guest
 
Posts: n/a
Default

OK - answering my own question (or part of it).
LayerCreate is an event not a method, which explains why I can't call it but now how I create one in the first place
Reply With Quote
  #8  
Old 03-02-2010, 01:01
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,787
Blog Entries: 11
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 Simple example

Here is a quick example. It will move any selected object to the new layer and make them invisible.
Code:
Sub SimpleExample()
    Dim sr As ShapeRange
    Dim lr As Layer
    
    Set sr = ActiveSelectionRange
    Set lr = ActivePage.CreateLayer("~HideMe~")
    
    sr.MoveToLayer lr
    lr.Visible = False
End Sub
Best of luck,

-Shelby
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
RecenrFile macro not showing thumbnails for X4 in Win 7 aakkaarr CorelDRAW/Corel DESIGNER VBA 0 22-01-2010 14:17
Listview & imagelist controls are not showing aakkaarr CorelDRAW/Corel DESIGNER VBA 3 20-01-2010 01:27
Embedded Excel worksheet showing up black Flow_FX General 1 19-07-2007 14:38
Problem showing some letter in Acrobat PDF xenio General 1 25-08-2006 11:47
Carriage Returns aren't showing up retchless CorelDRAW/Corel DESIGNER VBA 3 24-04-2006 09:56


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


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