OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Thread Tools Search this Thread Display Modes
Old 24-03-2009, 07:34
Posts: n/a
Default Create multiple elements in shaperange(faster)

I'm trying to create multiple paragraph text boxes, add them to shaperange and then add the range to powerclip.
The process is very sluggish so I'm looking for a way to create paragraphs without them being drawn on the screen until the shaperange gets added to powerclip, but since I'm currently using layer.CreateParagraphText for paragraph creation and don't know of an alternative, I'm in a bit of rot spot.
It's all being done in X4, if that means something.
Reply With Quote
Old 24-03-2009, 09:37
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4

Try the following code:

Sub QuickCreateText()
    Dim i As Integer
    Dim sr As New ShapeRange
    Dim s As Shape
    Dim x1 As Double, y1 As Double, x2 As Double, y2 As Double
    Optimization = True
    EventsEnabled = False
    For i = 1 To 100
        x1 = Rnd() * 6
        y1 = Rnd() * 9
        x2 = x1 + 2
        y2 = y1 + 2
        Set s = ActiveVirtualLayer.CreateParagraphText(x1, y1, x2, y2, "Text: " & i)
        sr.Add s
    Next i
    Set sr = ActiveDocument.LogCreateShapeRange(sr)
    Set s = ActiveLayer.CreateEllipse(ActivePage.LeftX, ActivePage.BottomY, ActivePage.RightX, ActivePage.TopY)
    sr.AddToPowerClip s, cdrFalse
    EventsEnabled = True
    Optimization = False
End Sub
Reply With Quote
Old 24-03-2009, 13:06
Posts: n/a

Thanks, very nice!
Reply With Quote

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
Shaperange to Layer ebu CorelDRAW/Corel DESIGNER VBA 2 19-01-2008 04:44
Draw X3: VBA: rotate behaviour for shaperange changed wOxxOm CorelDRAW/Corel DESIGNER VBA 0 30-01-2006 12:08
Can I create CustomShape with VBA for CD? Can I create tool? Jab CorelDRAW/Corel DESIGNER VBA 0 01-02-2005 05:02
Any way to make this faster? lasergraver Code Critique 3 23-04-2004 00:06
I need to update objects visibility faster NEHovis Corel Photo-Paint VBA 0 18-07-2003 07:54

All times are GMT -5. The time now is 16:44.

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