OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 16-01-2011, 12:37
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default Cannot rotate a virtual shape with the same precision as a shape

I have a simple function that rotates a line for example.
Draw a line and angle it at whatever angle, say a 3 inch 45 degree line.
The function will return the angle for rotation that rotates the line until it's at it's thinnest horizontal width.

I use a virtual shape to greatly improve speed.
When I create a virtual shape the angle for the prec (precision value) that I enter cannot seem to be less than .5
For a regular shape, not a virtual shape, I can use any value ie .01

Here's the function. Just pass the shape to it.

Private Function rotateIt2(s As Shape) As Double
    'Dim s As Shape
    Dim dup As Shape
    Dim thinnestw As Double
    Dim angle As Double
    Dim rotToThinW As Double, prec As Double

    prec = 0.25
    'Set dup = s.TreeNode.GetCopy().VirtualShape 'use a virtual shape instead.
    Set dup = s.Duplicate
    thinnestw = 10000
    angle = 0
    For angle = 0 To 20 Step prec
        dup.Rotate prec
        If dup.SizeWidth < thinnestw Then
            thinnestw = dup.SizeWidth
            rotToThinW = angle
        ElseIf dup.SizeWidth > thinnestw And angle <> 0 Then
            GoTo exitMe:
        End If
    Next angle
    rotateIt2 = rotToThinW + prec
End Function
Any ideas?
Reply With Quote

virtual shape rotation

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
Replace shape with another shape dungbtl CorelDRAW/Corel DESIGNER VBA 24 28-12-2019 05:56
Changing selection when two-shape group loses one shape Joe CorelDRAW/Corel DESIGNER VBA 1 19-02-2009 03:50
a shape on top of another Seelenquell CorelDRAW/Corel DESIGNER VBA 15 01-03-2008 09:08
Get Shape Index ID Value m31uk3 CorelDRAW/Corel DESIGNER VBA 6 08-02-2008 19:50
Numbers as shape name clausm General 2 22-03-2007 13:02

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

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