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 12-01-2011, 13:54
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

TobWen, just comment out or delete following line: .VirtualShape.SetBoundingBox x, y, w, h, KeepAspect:=True
Reply With Quote
  #12  
Old 12-01-2011, 13:57
TobWen
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by wOxxOm View Post
TobWen, just comment out or delete following line: .VirtualShape.SetBoundingBox x, y, w, h, KeepAspect:=True
That has been my first try, but the object gets evaporate only - not replaced :-(
Reply With Quote
  #13  
Old 12-01-2011, 14:29
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

sorry, my bad :p
replace
Code:
      sh.GetBoundingBox x, y, w, h
      With AgentSmith.TreeNode.GetCopy
         .VirtualShape.SetBoundingBox x, y, w, h, KeepAspect:=True
with
Code:
      sh.GetPosition x,y
      With AgentSmith.TreeNode.GetCopy
         .VirtualShape.SetPosition x,y
Reply With Quote
  #14  
Old 12-01-2011, 14:54
TobWen
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by wOxxOm View Post
sorry, my bad :p
replace
Code:
      sh.GetPosition x,y
      With AgentSmith.TreeNode.GetCopy
         .VirtualShape.SetPosition x,y
Wow nice, it works! Thanks a lot.
I'm using your code to exchange map symbols. Corel's symbol engine still can't handle transparency...

MMh ... perhaps a last question [for today ]:
Would it be possible to clone an object instead copying it? Then I could change the master object only and everything else would change immediately.

Best regards,
Tobias
Reply With Quote
  #15  
Old 12-01-2011, 15:14
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

probably this will work, I haven't tested it:

replace
Code:
   Set VSR = New ShapeRange
   ActiveDocument.ReferencePoint = cdrCenter
   For Each sh In sr
      sh.GetBoundingBox x, y, w, h
      With AgentSmith.TreeNode.GetCopy
         .VirtualShape.SetBoundingBox x, y, w, h, KeepAspect:=True
         .LinkAsChildOf sh.Layer.TreeNode
         VSR.Add .VirtualShape
      End With
   Next
   
   ActiveDocument.LogCreateShapeRange VSR
with
Code:
   ActiveDocument.BeginCommandGroup "Scatter clones": Optimization = True: EventsEnabled = False: ActiveDocument.PreserveSelection = False
   For Each sh In sr
      sh.GetPosition x,y
      with AgentSmith.Clone
         .SetPosition x,y
         .MoveToLayer sh.Layer
      End With
   Next
   ActiveDocument.EndCommandGroup: Optimization = False: EventsEnabled = True: ActiveDocument.PreserveSelection = True
   CorelScript.RedrawScreen
Reply With Quote
  #16  
Old 12-01-2011, 15:50
TobWen
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by wOxxOm View Post
probably this will work, I haven't tested it:
Yes, it works! Thanks again. Very, very good work!
Reply With Quote
  #17  
Old 15-01-2011, 19:56
TobWen
Guest
 
Posts: n/a
Default

Hi wOxxOm,

another idea concerning this code:

I want to replace a dot (a small circle) with a pushpin.

Is it possible to place the tip of a pushpin/needle on the old center of my dot, like Google Maps does for its markers?

The current script would center the pushpin on the dot only :-)

Best regards,
Tobias
Reply With Quote
  #18  
Old 17-01-2011, 11:08
TobWen
Guest
 
Posts: n/a
Default

I've run into a new problem:
When replacing a grouped object with those small circles, each member of the group get replaced and note the group itself :-(
That's how it looks like: http://imagebin.org/133071

Edit: I've fixed it myself. I've just changed
Code:
Set sr = ActiveSelection.Shapes.FindShapes()
into
Code:
Set sr = ActiveSelection.Shapes.All()
Best,
Tobias

Last edited by TobWen; 17-01-2011 at 11:24.
Reply With Quote
  #19  
Old 06-11-2012, 21:12
TobWen TobWen is offline
Junior Member
 
Join Date: Oct 2007
Posts: 15
Default

It stopped working in CorelDRAW v6

Can anyone help me to fix it?
Reply With Quote
  #20  
Old 06-11-2012, 21:14
TobWen TobWen is offline
Junior Member
 
Join Date: Oct 2007
Posts: 15
Default

Gnahh ... my fault, works again
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
Trouble wtih shape names. jahmer Macros/Add-ons 13 23-01-2008 19:05
Symbol shape is not found in a group squonk CorelDRAW/Corel DESIGNER VBA 1 14-06-2007 06:32
CorelDRAW X3 VBA Code - Shape & Color LIster JudyHNM Code Critique 2 05-04-2007 14:02
Any idea what's wrong with this shape? jemmyell CorelDRAW/Corel DESIGNER VBA 4 08-05-2006 18:15
Howto uniquely identify a shape in VBA code jemmyell CorelDRAW/Corel DESIGNER VBA 9 11-02-2005 21:05


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


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