OberonPlace.com Forums Cannot rotate a virtual shape with the same precision as a shape
 Blogs Gallery FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

#1
16-01-2011, 12:37
 runflacruiser Senior Member Join Date: Jun 2009 Location: Pigeon Forge, TN USA Posts: 811
Cannot rotate a virtual shape with the same precision as a shape

Hi.
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.
But...
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.

Code:
```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
exitMe:
dup.Delete
rotateIt2 = rotToThinW + prec
End Function```
Any ideas?
-John

 Tags virtual shape rotation

 Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home OberonPlace Discussion     Site News     Web site suggestions     Image Gallery     Testing Oberon Products     CurveWorks     SecuriDesign     Calendar Wizard     Oberon Function Plotter     Jigsaw Puzzle Creator     Other Oberon Commercial Products     New product ideas Corel User Forums     CorelDRAW         General         Tutorials         FAQ         Feature requests/wishlist         Macros/Add-ons         Artwork Showcase     Corel DESIGNER         General         Tutorials         FAQ         Feature requests/wishlist         Macros/Add-ons         Artwork Showcase     Corel PHOTO-PAINT         General         Tutorials         FAQ         Feature requests/wishlist         Macros/Add-ons         Artwork Showcase     General         About Corel         Off-Topic Developer Forums     OberonPlace Development Portal     VBA         CorelDRAW/Corel DESIGNER VBA         Corel Photo-Paint VBA         Code Critique     Corel Script         CorelDRAW CS         Corel Photo-Paint CS

 Similar Threads Thread Thread Starter Forum Replies Last Post dungbtl CorelDRAW/Corel DESIGNER VBA 24 28-12-2019 05:56 Joe CorelDRAW/Corel DESIGNER VBA 1 19-02-2009 03:50 Seelenquell CorelDRAW/Corel DESIGNER VBA 15 01-03-2008 09:08 m31uk3 CorelDRAW/Corel DESIGNER VBA 6 08-02-2008 19:50 clausm General 2 22-03-2007 13:02

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

 OberonPlace.com - Archive - Top