<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.harlamenkov.ru/index.php?action=history&amp;feed=atom&amp;title=EN%2Fdocumentation%2Fbasic_guide%2Fediting_drawing_objects</id>
	<title>EN/documentation/basic guide/editing drawing objects - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.harlamenkov.ru/index.php?action=history&amp;feed=atom&amp;title=EN%2Fdocumentation%2Fbasic_guide%2Fediting_drawing_objects"/>
	<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/editing_drawing_objects&amp;action=history"/>
	<updated>2026-11-11T13:50:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/editing_drawing_objects&amp;diff=16603&amp;oldid=prev</id>
		<title>Sancho: Основной текст</title>
		<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/editing_drawing_objects&amp;diff=16603&amp;oldid=prev"/>
		<updated>2011-09-05T15:51:58Z</updated>

		<summary type="html">&lt;p&gt;Основной текст&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;section begin=title /&amp;gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:&amp;lt;/noinclude&amp;gt;Editing Drawing Objects&amp;lt;noinclude&amp;gt;}}&amp;lt;/noinclude&amp;gt;&amp;lt;section end=title /&amp;gt;{{BreadCrumbL10n}}&lt;br /&gt;
&lt;br /&gt;
{{Documentation/BASICGuideTOC&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|ShowPrevPage=block&lt;br /&gt;
|PrevPage=EN/documentation/basic_guide/structure_of_drawings&lt;br /&gt;
|NextPage=EN/documentation/basic_guide/presentations&lt;br /&gt;
|draw=block&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
== Grouping Objects ==&lt;br /&gt;
&lt;br /&gt;
In many situations, it is useful to group several individual drawing objects together so that they behave as a single large object.&lt;br /&gt;
&lt;br /&gt;
The following example combines two drawing objects:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Doc As Object&lt;br /&gt;
Dim Page As Object&lt;br /&gt;
Dim Square As Object&lt;br /&gt;
Dim Circle As Object&lt;br /&gt;
Dim Shapes As Object&lt;br /&gt;
Dim Group As Object&lt;br /&gt;
Dim Point As New com.sun.star.awt.Point&lt;br /&gt;
Dim Size As New com.sun.star.awt.Size&lt;br /&gt;
Dim NewPos As New com.sun.star.awt.Point&lt;br /&gt;
Dim Height As Long&lt;br /&gt;
Dim Width As Long&lt;br /&gt;
 &lt;br /&gt;
Doc = ThisComponent&lt;br /&gt;
Page = Doc.DrawPages(0)&lt;br /&gt;
Point.x = 3000&lt;br /&gt;
Point.y = 3000&lt;br /&gt;
Size.Width = 3000&lt;br /&gt;
Size.Height = 3000&lt;br /&gt;
' create square drawing element&lt;br /&gt;
Square = Doc.createInstance(&amp;quot;com.sun.star.drawing.RectangleShape&amp;quot;)&lt;br /&gt;
Square.Size = Size&lt;br /&gt;
Square.Position = Point&lt;br /&gt;
Square.FillColor = RGB(255,128,128) &lt;br /&gt;
Page.add(Square)&lt;br /&gt;
&lt;br /&gt;
' create circle drawing element&lt;br /&gt;
Circle = Doc.createInstance(&amp;quot;com.sun.star.drawing.EllipseShape&amp;quot;)&lt;br /&gt;
Circle.Size = Size&lt;br /&gt;
Circle.Position = Point&lt;br /&gt;
Circle.FillColor = RGB(255,128,128) &lt;br /&gt;
Circle.FillColor = RGB(0,255,0)&lt;br /&gt;
Page.add(Circle)&lt;br /&gt;
&lt;br /&gt;
' combine square and circle drawing elements&lt;br /&gt;
Shapes = createUnoService(&amp;quot;com.sun.star.drawing.ShapeCollection&amp;quot;)&lt;br /&gt;
Shapes.add(Square)&lt;br /&gt;
&lt;br /&gt;
Shapes.add(Circle)&lt;br /&gt;
Group = Page.group(Shapes)&lt;br /&gt;
' centre combined drawing elements&lt;br /&gt;
Height = Page.Height&lt;br /&gt;
Width = Page.Width&lt;br /&gt;
NewPos.X = Width / 2&lt;br /&gt;
NewPos.Y = Height / 2&lt;br /&gt;
Height = Group.Size.Height&lt;br /&gt;
Width = Group.Size.Width&lt;br /&gt;
NewPos.X = NewPos.X - Width / 2&lt;br /&gt;
NewPos.Y = NewPos.Y - Height / 2&lt;br /&gt;
Group.Position = NewPos&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code creates a rectangle and a circle and inserts them into a page. It then creates an object that supports the &amp;lt;idl&amp;gt;com.sun.star.drawing.ShapeCollection&amp;lt;/idl&amp;gt; service and uses the &amp;lt;tt&amp;gt;Add&amp;lt;/tt&amp;gt; method to add the rectangle and the circle to this object. The &amp;lt;tt&amp;gt;ShapeCollection&amp;lt;/tt&amp;gt; is added to the page using the &amp;lt;tt&amp;gt;Group&amp;lt;/tt&amp;gt; method and returns the actual &amp;lt;tt&amp;gt;Group&amp;lt;/tt&amp;gt; object that can be edited like an individual &amp;lt;tt&amp;gt;Shape&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you want to format the individual objects of a group, apply the formatting before you add them to the group. You cannot modify the objects once they are in the group.&lt;br /&gt;
&lt;br /&gt;
== Rotating and Shearing Drawing Objects ==&lt;br /&gt;
&lt;br /&gt;
All of the drawing objects that are described in the previous sections can also be rotated and sheared using the &amp;lt;idl&amp;gt;com.sun.star.drawing.RotationDescriptor&amp;lt;/idl&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
The service provides the following properties:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;RotateAngle (Long)&amp;lt;/tt&amp;gt;:rotary angle in hundredths of a degree&lt;br /&gt;
;&amp;lt;tt&amp;gt;ShearAngle (Long)&amp;lt;/tt&amp;gt;:shear angle in hundredths of a degree&lt;br /&gt;
&lt;br /&gt;
The following example creates a rectangle and rotates it by 30 degrees using the &amp;lt;tt&amp;gt;RotateAngle&amp;lt;/tt&amp;gt; property:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Doc As Object&lt;br /&gt;
Dim Page As Object&lt;br /&gt;
Dim RectangleShape As Object&lt;br /&gt;
Dim Point As New com.sun.star.awt.Point&lt;br /&gt;
Dim Size As New com.sun.star.awt.Size&lt;br /&gt;
&lt;br /&gt;
Point.x = 1000&lt;br /&gt;
Point.y = 1000&lt;br /&gt;
Size.Width = 10000&lt;br /&gt;
Size.Height = 10000&lt;br /&gt;
&lt;br /&gt;
Doc = ThisComponent&lt;br /&gt;
Page = Doc.DrawPages(0)&lt;br /&gt;
&lt;br /&gt;
RectangleShape = Doc.createInstance(&amp;quot;com.sun.star.drawing.RectangleShape&amp;quot;)&lt;br /&gt;
RectangleShape.Size = Size&lt;br /&gt;
RectangleShape.Position = Point&lt;br /&gt;
&lt;br /&gt;
RectangleShape.RotateAngle = 3000&lt;br /&gt;
&lt;br /&gt;
Page.add(RectangleShape)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next example creates the same rectangle as in the previous example, but instead shears it through 30 degrees using the &amp;lt;tt&amp;gt;ShearAngle&amp;lt;/tt&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Doc As Object&lt;br /&gt;
Dim Page As Object&lt;br /&gt;
Dim RectangleShape As Object&lt;br /&gt;
Dim Point As New com.sun.star.awt.Point&lt;br /&gt;
Dim Size As New com.sun.star.awt.Size&lt;br /&gt;
&lt;br /&gt;
Point.x = 1000&lt;br /&gt;
Point.y = 1000&lt;br /&gt;
Size.Width = 10000&lt;br /&gt;
Size.Height = 10000&lt;br /&gt;
&lt;br /&gt;
Doc = ThisComponent&lt;br /&gt;
Page = Doc.DrawPages(0)&lt;br /&gt;
RectangleShape = Doc.createInstance(&amp;quot;com.sun.star.drawing.RectangleShape&amp;quot;)&lt;br /&gt;
RectangleShape.Size = Size&lt;br /&gt;
RectangleShape.Position = Point&lt;br /&gt;
&lt;br /&gt;
RectangleShape.ShearAngle = 3000&lt;br /&gt;
&lt;br /&gt;
Page.add(RectangleShape)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Searching and Replacing ==&lt;br /&gt;
&lt;br /&gt;
As in text documents, drawing documents provide a function for searching and replace. This function is similar to the one that is used in text documents as described in [[Documentation/BASIC_Guide/Text_Documents|Text Documents]]. However, in drawing documents the descriptor objects for searching and replacing are not created directly through the document object, but rather through the associated character level. The following example outlines the replacement process within a drawing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Doc As Object&lt;br /&gt;
Dim Page As Object&lt;br /&gt;
Dim ReplaceDescriptor As Object&lt;br /&gt;
Dim I As Integer&lt;br /&gt;
&lt;br /&gt;
Doc = ThisComponent&lt;br /&gt;
Page = Doc.DrawPages(0)&lt;br /&gt;
&lt;br /&gt;
ReplaceDescriptor = Page.createReplaceDescriptor()&lt;br /&gt;
ReplaceDescriptor.SearchString = &amp;quot;is&amp;quot;&lt;br /&gt;
ReplaceDescriptor.ReplaceString = &amp;quot;was&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For I = 0 to Doc.DrawPages.Count - 1&lt;br /&gt;
   Page = Doc.DrawPages(I)&lt;br /&gt;
   Page.ReplaceAll(ReplaceDescriptor) &lt;br /&gt;
Next I&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code uses the first page of the document to create a &amp;lt;tt&amp;gt;ReplaceDescriptor&amp;lt;/tt&amp;gt; and then applies this descriptor in a loop to all of the pages in the drawing document.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{{PDL1}}&lt;/div&gt;</summary>
		<author><name>Sancho</name></author>
		
	</entry>
</feed>