OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

circle segments in draw ?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Draw
View previous topic :: View next topic  
Author Message
Markus - Guest
Guest





PostPosted: Tue May 06, 2003 3:16 am    Post subject: circle segments in draw ? Reply with quote

Hi,

I'm a newbie to OpenOffice and I'm desperately looking for a way to draw circle segments (half circle, quarter circles and so on). Is there any way doing this ?
Until now all I can do is draw full circles.

Markus Question
Back to top
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Tue May 06, 2003 4:12 am    Post subject: Reply with quote

Try Help > Index tab > Ellipse pie and Ellipse segment.
Back to top
View user's profile Send private message
diedericr
Guest





PostPosted: Tue Mar 30, 2004 2:38 pm    Post subject: dividing a circle Reply with quote

Hi,

I've four questions with respect to draw:

1. I would like to divide a circle/ellips into unequal parts, starting at some pointA to point B (on circle) say 23 degrees on to point C, 45 degrees on from B etc.

2. How does one put a smaller ellips into a large one, centered on the same foci?

3. Having made the divisions mentioned in 1, is it possible to draw line at those divisions only between the 2 ellipses/circles?

4. Within those 'boxes' I want to place the signs of the zodiac; where do I do this? and any idea where I might find these?

Many thnaks,
Diederic
Back to top
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Wed Mar 31, 2004 9:33 am    Post subject: Reply with quote

If you are trying to draw pie charts using pie-sections of circles, this is easy to do with a macro. Just draw your circles, set the start and end angle you want. Set the two circles to the same size and position. Instant pie chart.

The problem I see here is that you can use the "Edit Points" toolbar icon to change the angles of a pie slice of an ellipse shape, but you cannot numerically set its values as you can in a macro.

Here is a simple example that draws a pie chart. As you can see, on Circle1 and Circle2, I just set the CircleStartAngle and CircleEndAngle to any number I want.

I don't know if having a simple macro example will help you to do what you want, but I thought I'd paste it anyway. Just copy and paste, and then click Run.

Code:

Sub Main
   oDoc = StarDesktop.loadComponentFromURL( "private:factory/sdraw", "_blank", 0, Array() )
   oDrawPage = oDoc.getDrawPages().getByIndex( 0 )
   
   oCircle1 = oDoc.createInstance( "com.sun.star.drawing.EllipseShape" )
   oDrawPage.add( oCircle1 )
   With oCircle1
      .Position = MakePoint( 8000, 10000 )
      .Size = MakeSize( 5000, 5000 )
      .LineStyle = com.sun.star.drawing.LineStyle.SOLID
      .LineWidth = 10
      .FillStyle = com.sun.star.drawing.FillStyle.SOLID
      .FillColor = RGB( 200, 200, 255 ) ' light blue
      .CircleKind = com.sun.star.drawing.CircleKind.SECTION
      .CircleStartAngle = 0 ' zero degrees
      .CircleEndAngle = 1000 ' ten degrees
   End With
   
   oCircle2 = oDoc.createInstance( "com.sun.star.drawing.EllipseShape" )
   oDrawPage.add( oCircle2 )
   With oCircle2
      .Position = MakePoint( 8000, 10000 )
      .Size = MakeSize( 5000, 5000 )
      .LineStyle = com.sun.star.drawing.LineStyle.SOLID
      .LineWidth = 10
      .FillStyle = com.sun.star.drawing.FillStyle.SOLID
      .FillColor = RGB( 255, 200, 200 ) ' light red
      .CircleKind = com.sun.star.drawing.CircleKind.SECTION
      .CircleStartAngle = 1000 ' ten degrees
      .CircleEndAngle = 36000 ' 360 degrees
   End With
   
   oSquare1 = oDoc.createInstance( "com.sun.star.drawing.RectangleShape" )
   oDrawPage.add( oSquare1 )
   With oSquare1
      .Position = MakePoint( 8000, 16000 )
      .Size = MakeSize( 500, 500 )
      .LineStyle = com.sun.star.drawing.LineStyle.SOLID
      .LineWidth = 10
      .FillStyle = com.sun.star.drawing.FillStyle.SOLID
      .FillColor = RGB( 200, 200, 255 ) ' light blue
   End With
   
   oSquare2 = oDoc.createInstance( "com.sun.star.drawing.RectangleShape" )
   oDrawPage.add( oSquare2 )
   With oSquare2
      .Position = MakePoint( 8000, 17000 )
      .Size = MakeSize( 500, 500 )
      .LineStyle = com.sun.star.drawing.LineStyle.SOLID
      .LineWidth = 10
      .FillStyle = com.sun.star.drawing.FillStyle.SOLID
      .FillColor = RGB( 255, 200, 200 ) ' light red
   End With
   
   oText1 = oDoc.createInstance( "com.sun.star.drawing.TextShape" )
   oDrawPage.add( oText1 )
   With oText1
      .Position = MakePoint( 9000, 16000 )
      .Size = MakeSize( 8000, 500 )
      .LineStyle = com.sun.star.drawing.LineStyle.NONE
      .FillStyle = com.sun.star.drawing.FillStyle.NONE
      .Text.setString( "SCO True statements" )
   End With
   
   oText2 = oDoc.createInstance( "com.sun.star.drawing.TextShape" )
   oDrawPage.add( oText2 )
   With oText2
      .Position = MakePoint( 9000, 17000 )
      .Size = MakeSize( 8000, 500 )
      .LineStyle = com.sun.star.drawing.LineStyle.NONE
      .FillStyle = com.sun.star.drawing.FillStyle.NONE
      .Text.setString( "SCO misstatements" )
   End With
End Sub




Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
   oPropertyValue = createUnoStruct( "com.sun.star.beans.PropertyValue" )
   If Not IsMissing( cName ) Then
      oPropertyValue.Name = cName
   EndIf
   If Not IsMissing( uValue ) Then
      oPropertyValue.Value = uValue
   EndIf
   MakePropertyValue() = oPropertyValue
End Function

Function MakePoint( ByVal x As Long, ByVal y As Long ) As com.sun.star.awt.Point
   oPoint = createUnoStruct( "com.sun.star.awt.Point" )
   oPoint.X = x
   oPoint.Y = y
   MakePoint() = oPoint
End Function

Function MakeSize( ByVal width As Long, ByVal height As Long ) As com.sun.star.awt.Size
   oSize = createUnoStruct( "com.sun.star.awt.Size" )
   oSize.Width = width
   oSize.Height = height
   MakeSize() = oSize
End Function




This gives me an idea to create an installable tool that lets you bring up a dialog box to edit the start/end angle of a pie slice in a drawing.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
diedericr
Guest





PostPosted: Sun Apr 11, 2004 8:26 pm    Post subject: division of 2 concentric circles Reply with quote

Thank s DannyB for your code. message I get: " basic syntax error' . What to do now?

I copied your code and pasted it into a new macro; tried to run that with above result.

Is there any where some simple documentation on macros?

Thanks again,
Diederic
Back to top
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Sun Apr 11, 2004 8:32 pm    Post subject: Re: division of 2 concentric circles Reply with quote

diedericr wrote:
Thank s DannyB for your code. message I get: " basic syntax error' . What to do now?


Any indication of which line has the error?

One possible problem is if a long line of Basic accidentially is broken onto multiple lines. A Basic statement that breaks onto multiple lines on purpose will have each line with an underscore (_) on a line that is continued to the next line.

I was able to select the above program, copy it, paste it into the macro of a document, and run it perfectly.



diedericr wrote:
Is there any where some simple documentation on macros?


See this....

http://www.oooforum.org/forum/viewtopic.php?p=24224#24224
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
diedericr
Guest





PostPosted: Tue Apr 13, 2004 2:34 pm    Post subject: circles Reply with quote

Hi DannyB,

I tried a few things, but still get the basic message: syntax error.
I deleted evything but the first instruction:
Sub Main
oDoc =StarDesktop.load etc
End Sub
same message in first line oDoc.

However, I realise that the line contains the word StarDesktop, assuming you use StarOffice. I use OpenOffice 1.1.0. I'll try changing Star to Open or OpenOffice.

Thanks again.
Diedericr
Back to top
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Tue Apr 13, 2004 3:02 pm    Post subject: Reply with quote

StarDesktop is the correct name for all past and present versions of OpenOffice.org.

Are you using a non-english version?
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
diedericr
Guest





PostPosted: Tue Apr 13, 2004 3:26 pm    Post subject: Reply with quote

As I discovered.

Using english version; first line still has a red arrow.

Diedericr
Back to top
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Wed Apr 14, 2004 7:09 am    Post subject: Reply with quote

I am thinking that it is necessary to build a new installable draw tool.

The tool would add a new command to the Tools menu (via. the Add On menu).

The way to use would be as follows....
1. Select one or more Ellipse shapes on your drawing.
2. Tools --> Add Ons --> Dannys Draw Power Tools --> Edit Ellipse

A new dialog box appears allowing you to align the centers of the ellipses, or to adjust the starting and ending angle of the ellipse pie slices.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
diedericr
Guest





PostPosted: Mon Apr 26, 2004 7:32 pm    Post subject: draw ellipses Reply with quote

Hi Danny,

What is 'Danny's Draw Power Tool'?

I tried to use macro you made; however the message remains the same, syntax error in 1st line. Which reads:
oDoc = StarDesktop.LoadComponentFormURL( "private:factory/sdraw" , "_blank ", 0. Array() ).

Tried understanding RealBasic by M Neuburg, but not much help.

Thanks for your help,
Diederic
Back to top
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Wed Apr 28, 2004 2:51 pm    Post subject: Reply with quote

Danny's Draw Power Tools is a collection of Draw macros to draw complex shapes in OOo Draw.

Code:
oDoc = StarDesktop.LoadComponentFormURL( "private:factory/sdraw" , "_blank ", 0. Array() ).


There should not be any punctuation after the last parenthesis.

The punctuation between 0 and Array() should be a comma.

Compare the statement with the original one I gave in my macro earlier in this thread. See the missing comma, and the extra period at the end?
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
diedericr
Guest





PostPosted: Wed Apr 28, 2004 7:18 pm    Post subject: Reply with quote

Hi Danny,

Mistakes in first line, not in original. I've your tools, unzipped them read your readme file. But wjere do I put the tools?

Thanks,
Diedeiric
Back to top
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Thu Apr 29, 2004 6:35 am    Post subject: Reply with quote

Put them anywhere you wish. They are just documents. They do not "install" into the office. (Unlike the next generation I'm working on!)

One document contains all of the tools. One button activates each tool as a dialog box.

Other documents are documentation about how to use each of the tools.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Draw All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group