![]() |
#1
|
|||
|
|||
![]()
Is there any way to make Draw VBA understanding, that a couple of layers are selected? LayerRange class seems to work only in PP VBA.
Tomasz |
#2
|
||||
|
||||
![]()
what goal do you pursue?
if you're processing shapes from several layers then a ShapeRange will do like this: Code:
dim SR as shapeRange set SR=ActiveDocument.Layers(1).FindShapes SR.AddRange ActiveDocument.Layers(2).FindShapes SR.Fill.ApplyUniformFill CreateCMYKColor(0,0,0,100) |
#3
|
|||
|
|||
![]()
Thank you wOxxOm.
I meant strictly operations on a couple of layers selected manually by an user. For example when one selects two or more layers (by ctrl clicking them), the macro would make these layers editable, printable and visible. Of course I can select all objects on the desired collection of layers, or I can just define an array with layers indexes to be processed. However the problem is how to make VBA aware that certain layers are selected. Tomasz |
#5
|
||||
|
||||
![]()
yeah, indeed, you'll have to make your own userform UI which would allow multiple selections
|
#6
|
|||
|
|||
![]()
Well... actually... I can do it in my X3:
1. I click on a layer, 2. then holding Ctrl key pressed I click on other layers. 3. having collection of layers selected in that way, I can right click on them and for example make all of them invisible at once or all of them imprintable at once. Of course it doesn't mean that all layers become activelayers. Only first clicked layer becomes "active", however UI does see other as selected. Tomasz |
#7
|
||||
|
||||
![]()
ah, in the Layers mode view it's possible to multiselect, then I guess you can try to read the SysTreeView32 inside Object Manager using WinAPI
|
#8
|
|||
|
|||
![]()
wOxxOm,
I had a slight hope that I would manage to do it easily with use of an overlooked cDraw class. As the hope vanished, I have to learn more about WinAPI classes ![]() Tomasz |
#9
|
||||
|
||||
![]()
that's not too complicated, here's some code for FLOATING ObjectManager, something similar is required for docked OM.
Code:
dim h& h=FindWindowExA(0,0,"Object Manager","Afx:62210000:1000:00010011:00000010:00000000") if h=0 then msgbox "No ObjectManager window found" h=FindWindowExA(h,0,vbNullString,"#32770") h=FindWindowExA(h,0,vbNullString,"#32770") h=FindWindowExA(h,0,vbNullString,"SysTreeView32") Search the internet for any TreeView examples, there are plenty of them |
#10
|
|||
|
|||
![]()
Thanks!
I understand that the first line returns the handle of the Object Manager itself. But why the window name of the Object Manager object is "Afx:62210000:1000:00010011:00000010:00000000"?? ![]() Has a docked OM object different window name here? The next two lines are just to dig deeper, until the treeview handle is supposed to be found in the line no 4. Am I correct? Tomasz |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Copy Selected Objects to other pages maintaining layers | knowbodynow | Code Critique | 6 | 13-12-2015 18:46 |
Layers And List Boxs | knowbodynow | CorelDRAW/Corel DESIGNER VBA | 3 | 06-09-2007 07:05 |
Move objects to selected layer (either "a" or "b") | 6fazer | CorelDRAW/Corel DESIGNER VBA | 3 | 07-03-2007 19:10 |
Copy Selected Objects to new page maintaining layers | knowbodynow | CorelDRAW/Corel DESIGNER VBA | 5 | 07-03-2007 08:49 |
finding node angles? | IanVincent | CorelDRAW/Corel DESIGNER VBA | 4 | 12-12-2003 23:32 |