Создание прямоугольника

Ниже приведён пример использования операции SetWspMd для создания новой фигуры - прямоугольника. В запросе передаётся шаблон, указывающий необходимость создания нового прямоугольника. В ответе возвращаются настройки прямоугольника.

SOAP-запрос:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetWspMd xmlns="http://www.fsight.ru/PP.SOM.Som">
<tWsp xmlns="">
  <id>S1!M!S!WSP1</id>
  </tWsp>
<tArg xmlns="">
<pattern>
  <obInst>true</obInst>
<action>
  <CreateRectangle>true</CreateRectangle>
  </action>
  </pattern>
  <meta />
  </tArg>
  </SetWspMd>
  </s:Body>
  </s:Envelope>

SOAP-ответ:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetWspMdResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>S1!M!S!WSP1</id>
  </id>
<meta xmlns="">
<createdRectangle>
<ChildShapes>
  <its />
  </ChildShapes>
  <Workspace />
  <Id>Shape5</Id>
  <Parent />
<Style>
  <Workspace />
  <Id>Обычный</Id>
  <IsPrivate>0</IsPrivate>
  <ChildStyles />
  <TextFontFamilyName>Arial</TextFontFamilyName>
  <TextFontSize>10</TextFontSize>
  <TextFontStyleBold>0</TextFontStyleBold>
  <TextFontStyleItalic>0</TextFontStyleItalic>
  <TextFontStyleUnderline>0</TextFontStyleUnderline>
  <TextFontStyleStrikeout>0</TextFontStyleStrikeout>
  <TextFontBrushColor>4278190080</TextFontBrushColor>
  <TextFontBrushTransparent>0</TextFontBrushTransparent>
  <LinePenColor>4287336599</LinePenColor>
  <LinePenTransparent>0</LinePenTransparent>
  <LinePenWxDashStyle>Solid</LinePenWxDashStyle>
  <LinePenWidth>0.3533568978309631</LinePenWidth>
  <LinePenCapSize>2</LinePenCapSize>
  <LinePenBeginWxCap>Flat</LinePenBeginWxCap>
  <LinePenEndWxCap>Flat</LinePenEndWxCap>
  <BackgroundBrushForeColor>-1</BackgroundBrushForeColor>
  <BackgroundBrushForeTransparent>0</BackgroundBrushForeTransparent>
  <BackgroundBrushPattern>Solid</BackgroundBrushPattern>
  <BackgroundBrushBackColor>4278190080</BackgroundBrushBackColor>
  <BackgroundBrushBackTransparent>0</BackgroundBrushBackTransparent>
  <ShadowBrushForeColor>4278190080</ShadowBrushForeColor>
  <ShadowBrushForeTransparent>0</ShadowBrushForeTransparent>
  <ShadowBrushPattern>None</ShadowBrushPattern>
  <ShadowBrushBackColor>-1</ShadowBrushBackColor>
  <ShadowBrushBackTransparent>0</ShadowBrushBackTransparent>
  <TextBackBrushColor>-1</TextBackBrushColor>
  <TextBackBrushTransparent>100</TextBackBrushTransparent>
  <TextPosition>Over</TextPosition>
  <TextAlignmentHorizontal>Center</TextAlignmentHorizontal>
  <TextAlignmentVertical>Center</TextAlignmentVertical>
  <TextMarginLeft>0</TextMarginLeft>
  <TextMarginTop>0</TextMarginTop>
  <TextMarginRight>0</TextMarginRight>
  <TextMarginBottom>0</TextMarginBottom>
  <PictureTransparent>0</PictureTransparent>
  <PictureAlignmentHorizontal>Center</PictureAlignmentHorizontal>
  <PictureAlignmentVertical>Center</PictureAlignmentVertical>
  <PictureMarginLeft>0</PictureMarginLeft>
  <PictureMarginTop>0</PictureMarginTop>
  <PictureMarginRight>0</PictureMarginRight>
  <PictureMarginBottom>0</PictureMarginBottom>
  <AdjustMode>None</AdjustMode>
  <WordWrap>BreakWords</WordWrap>
  <PictureProportional>0</PictureProportional>
  <PictureStretch>0</PictureStretch>
  <PictureAutoSize>0</PictureAutoSize>
  </Style>
<SelectionStyle>
  <Workspace />
  <Id>Selection</Id>
  <IsPrivate>0</IsPrivate>
  <ChildStyles />
  <TextFontFamilyName>Arial</TextFontFamilyName>
  <TextFontSize>10</TextFontSize>
  <TextFontStyleBold>0</TextFontStyleBold>
  <TextFontStyleItalic>0</TextFontStyleItalic>
  <TextFontStyleUnderline>0</TextFontStyleUnderline>
  <TextFontStyleStrikeout>0</TextFontStyleStrikeout>
  <TextFontBrushColor>4278190080</TextFontBrushColor>
  <TextFontBrushTransparent>0</TextFontBrushTransparent>
  <LinePenColor>4287336599</LinePenColor>
  <LinePenTransparent>0</LinePenTransparent>
  <LinePenWxDashStyle>Solid</LinePenWxDashStyle>
  <LinePenWidth>0.3533568978309631</LinePenWidth>
  <LinePenCapSize>2</LinePenCapSize>
  <LinePenBeginWxCap>Flat</LinePenBeginWxCap>
  <LinePenEndWxCap>Flat</LinePenEndWxCap>
  <BackgroundBrushForeColor>-1</BackgroundBrushForeColor>
  <BackgroundBrushForeTransparent>0</BackgroundBrushForeTransparent>
  <BackgroundBrushPattern>Solid</BackgroundBrushPattern>
  <BackgroundBrushBackColor>4278190080</BackgroundBrushBackColor>
  <BackgroundBrushBackTransparent>0</BackgroundBrushBackTransparent>
  <ShadowBrushForeColor>4278190080</ShadowBrushForeColor>
  <ShadowBrushForeTransparent>0</ShadowBrushForeTransparent>
  <ShadowBrushPattern>None</ShadowBrushPattern>
  <ShadowBrushBackColor>-1</ShadowBrushBackColor>
  <ShadowBrushBackTransparent>0</ShadowBrushBackTransparent>
  <TextBackBrushColor>-1</TextBackBrushColor>
  <TextBackBrushTransparent>100</TextBackBrushTransparent>
  <TextPosition>Over</TextPosition>
  <TextAlignmentHorizontal>Center</TextAlignmentHorizontal>
  <TextAlignmentVertical>Center</TextAlignmentVertical>
  <TextMarginLeft>0</TextMarginLeft>
  <TextMarginTop>0</TextMarginTop>
  <TextMarginRight>0</TextMarginRight>
  <TextMarginBottom>0</TextMarginBottom>
  <PictureTransparent>0</PictureTransparent>
  <PictureAlignmentHorizontal>Center</PictureAlignmentHorizontal>
  <PictureAlignmentVertical>Center</PictureAlignmentVertical>
  <PictureMarginLeft>0</PictureMarginLeft>
  <PictureMarginTop>0</PictureMarginTop>
  <PictureMarginRight>0</PictureMarginRight>
  <PictureMarginBottom>0</PictureMarginBottom>
  <AdjustMode>None</AdjustMode>
  <WordWrap>BreakWords</WordWrap>
  <PictureProportional>0</PictureProportional>
  <PictureStretch>0</PictureStretch>
  <PictureAutoSize>0</PictureAutoSize>
  </SelectionStyle>
  <TransparentColor>0</TransparentColor>
<PinPosition>
  <x>0</x>
  <y>0</y>
  </PinPosition>
<LocalPinPositionCoeff>
  <x>0.5</x>
  <y>0.5</y>
  </LocalPinPositionCoeff>
<Size>
  <width>30</width>
  <height>20</height>
  </Size>
  <Angle>0</Angle>
  <Text />
  <TextVertOffset>0</TextVertOffset>
  <TextHorzOffset>0</TextHorzOffset>
  <GroupBehaviour>ScaleWithGroup</GroupBehaviour>
  <DrawType>ShapeDefault</DrawType>
  <Cursor>OverShape</Cursor>
<Tag>
  <v />
  </Tag>
<ConnectionPoints>
<it>
  <x>-15</x>
  <y>-0</y>
  </it>
<it>
  <x>-0</x>
  <y>-10</y>
  </it>
<it>
  <x>15</x>
  <y>-0</y>
  </it>
<it>
  <x>-0</x>
  <y>10</y>
  </it>
<it>
  <x>-0</x>
  <y>-0</y>
  </it>
  </ConnectionPoints>
  <ConnectedShapes />
  <FormattedText>{\rtf1{\*\DCF FF bius, TC 0, BC 16777215, FN Arial, FS 200}{\*\WORDWRAP 1}{\*\VERTICALALIGNMENT 1}{\*\HORIZONTAL_ALIGNMENT_V2 ,CENTER}{\*\GENERALALIGNMENT 0}\ansi\ansicpg1251\deff0\nouicompat\deflang1049{\fonttbl{\f0\fnil\fcharset0 Arial;}} {\colortbl ;\red0\green0\blue0;\red255\green255\blue255;} {\*\generator Riched20 10.0.14393}\viewkind4\uc1 \pard\qc\cf1\highlight2\fs20\lang1033\par } </FormattedText>
  <AllowedInteractions>511</AllowedInteractions>
<MinSize>
  <width>0</width>
  <height>0</height>
  </MinSize>
  <LoadingVersion>14</LoadingVersion>
<PositionRect>
  <left>-15</left>
  <top>-10</top>
  <width>30</width>
  <height>20</height>
  </PositionRect>
<RequiredActiveWndRect>
  <left>15</left>
  <top>10</top>
  <width>0</width>
  <height>0</height>
  </RequiredActiveWndRect>
  <Visible>1</Visible>
  <Type>Rectangle</Type>
  </createdRectangle>
  </meta>
  </SetWspMdResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON-запрос:

{
"SetWspMd" :
{
"tWsp" :
{
"id" : "S1!M!S!WSP1"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"action" :
{
"CreateRectangle" : "true"
}
},
"meta" : ""
}
}
}

JSON-ответ:

{
"SetWspMdResult" :
{
"id" :
{
"id" : "S1!M!S!WSP1"
},
"meta" :
{
"createdRectangle" :
{
"ChildShapes" :
{
"its" : ""
},
"Workspace" : "",
"Id" : "Shape5",
"Parent" : "",
"Style" :
{
"Workspace" : "",
"Id" : "Обычный",
"IsPrivate" : "0",
"ChildStyles" : "",
"TextFontFamilyName" : "Arial",
"TextFontSize" : "10",
"TextFontStyleBold" : "0",
"TextFontStyleItalic" : "0",
"TextFontStyleUnderline" : "0",
"TextFontStyleStrikeout" : "0",
"TextFontBrushColor" : "4278190080",
"TextFontBrushTransparent" : "0",
"LinePenColor" : "4287336599",
"LinePenTransparent" : "0",
"LinePenWxDashStyle" : "Solid",
"LinePenWidth" : "0.3533568978309631",
"LinePenCapSize" : "2",
"LinePenBeginWxCap" : "Flat",
"LinePenEndWxCap" : "Flat",
"BackgroundBrushForeColor" : "4294967295",
"BackgroundBrushForeTransparent" : "0",
"BackgroundBrushPattern" : "Solid",
"BackgroundBrushBackColor" : "4278190080",
"BackgroundBrushBackTransparent" : "0",
"ShadowBrushForeColor" : "4278190080",
"ShadowBrushForeTransparent" : "0",
"ShadowBrushPattern" : "None",
"ShadowBrushBackColor" : "4294967295",
"ShadowBrushBackTransparent" : "0",
"TextBackBrushColor" : "4294967295",
"TextBackBrushTransparent" : "100",
"TextPosition" : "Over",
"TextAlignmentHorizontal" : "Center",
"TextAlignmentVertical" : "Center",
"TextMarginLeft" : "0",
"TextMarginTop" : "0",
"TextMarginRight" : "0",
"TextMarginBottom" : "0",
"PictureTransparent" : "0",
"PictureAlignmentHorizontal" : "Center",
"PictureAlignmentVertical" : "Center",
"PictureMarginLeft" : "0",
"PictureMarginTop" : "0",
"PictureMarginRight" : "0",
"PictureMarginBottom" : "0",
"AdjustMode" : "None",
"WordWrap" : "BreakWords",
"PictureProportional" : "0",
"PictureStretch" : "0",
"PictureAutoSize" : "0"
},
"SelectionStyle" :
{
"Workspace" : "",
"Id" : "Selection",
"IsPrivate" : "0",
"ChildStyles" : "",
"TextFontFamilyName" : "Arial",
"TextFontSize" : "10",
"TextFontStyleBold" : "0",
"TextFontStyleItalic" : "0",
"TextFontStyleUnderline" : "0",
"TextFontStyleStrikeout" : "0",
"TextFontBrushColor" : "4278190080",
"TextFontBrushTransparent" : "0",
"LinePenColor" : "4287336599",
"LinePenTransparent" : "0",
"LinePenWxDashStyle" : "Solid",
"LinePenWidth" : "0.3533568978309631",
"LinePenCapSize" : "2",
"LinePenBeginWxCap" : "Flat",
"LinePenEndWxCap" : "Flat",
"BackgroundBrushForeColor" : "4294967295",
"BackgroundBrushForeTransparent" : "0",
"BackgroundBrushPattern" : "Solid",
"BackgroundBrushBackColor" : "4278190080",
"BackgroundBrushBackTransparent" : "0",
"ShadowBrushForeColor" : "4278190080",
"ShadowBrushForeTransparent" : "0",
"ShadowBrushPattern" : "None",
"ShadowBrushBackColor" : "4294967295",
"ShadowBrushBackTransparent" : "0",
"TextBackBrushColor" : "4294967295",
"TextBackBrushTransparent" : "100",
"TextPosition" : "Over",
"TextAlignmentHorizontal" : "Center",
"TextAlignmentVertical" : "Center",
"TextMarginLeft" : "0",
"TextMarginTop" : "0",
"TextMarginRight" : "0",
"TextMarginBottom" : "0",
"PictureTransparent" : "0",
"PictureAlignmentHorizontal" : "Center",
"PictureAlignmentVertical" : "Center",
"PictureMarginLeft" : "0",
"PictureMarginTop" : "0",
"PictureMarginRight" : "0",
"PictureMarginBottom" : "0",
"AdjustMode" : "None",
"WordWrap" : "BreakWords",
"PictureProportional" : "0",
"PictureStretch" : "0",
"PictureAutoSize" : "0"
},
"TransparentColor" : "0",
"PinPosition" :
{
"x" : "0",
"y" : "0"
},
"LocalPinPositionCoeff" :
{
"x" : "0.5",
"y" : "0.5"
},
"Size" :
{
"width" : "30",
"height" : "20"
},
"Angle" : "0",
"Text" : "",
"TextVertOffset" : "0",
"TextHorzOffset" : "0",
"GroupBehaviour" : "ScaleWithGroup",
"DrawType" : "ShapeDefault",
"Cursor" : "OverShape",
"Tag" :
{
"v" : ""
},
"ConnectionPoints" :
{
"it" :
[
{
"x" : "-15",
"y" : "-0"
},
{
"x" : "-0",
"y" : "-10"
},
{
"x" : "15",
"y" : "-0"
},
{
"x" : "-0",
"y" : "10"
},
{
"x" : "-0",
"y" : "-0"
}
]
},
"ConnectedShapes" : "",
"FormattedText" : "{\rtf1{\*\DCF FF bius, TC 0, BC 16777215, FN Arial, FS 200}{\*\WORDWRAP 1}{\*\VERTICALALIGNMENT 1}{\*\HORIZONTAL_ALIGNMENT_V2 ,CENTER}{\*\GENERALALIGNMENT 0}\ansi\ansicpg1251\deff0\nouicompat\deflang1049{\fonttbl{\f0\fnil\fcharset0 Arial;}} {\colortbl ;\red0\green0\blue0;\red255\green255\blue255;} {\*\generator Riched20 10.0.14393}\viewkind4\uc1 \pard\qc\cf1\highlight2\fs20\lang1033\par } ",
"AllowedInteractions" : "511",
"MinSize" :
{
"width" : "0",
"height" : "0"
},
"LoadingVersion" : "14",
"PositionRect" :
{
"left" : "-15",
"top" : "-10",
"width" : "30",
"height" : "20"
},
"RequiredActiveWndRect" :
{
"left" : "15",
"top" : "10",
"width" : "0",
"height" : "0"
},
"Visible" : "1",
"Type" : "Rectangle"
}
}
}
}
public static SetWspMdResult WspCreateRectangle(WspId moniker)
{
var somClient = new SomPortTypeClient(); //Прокси-объект для выполнения операций
//Параметры выполнения операции
var tSet = new SetWspMd()
{
tArg = new SetWspMdArg()
{
pattern = new WspMdPattern()
{
action = new IWrspWorkspaceAction()
{
CreateRectangle = true
}
},
meta = new WspMd()
},
tWsp = moniker
};
//Создание прямоугольника
var tResult = somClient.SetWspMd(tSet);
return tResult;
}

См. также:

SetWspMd: Операция