<?xml version="1.0" encoding="gb2312"?>
<vg version="453" gridsize="4" activesheetindex="7" range="0,0,800,553" caption="般箱子" bordericons="7" borderstyle="3" scrollbars="3" windowstate="0" backcolor="$FFFFFF" frontcolor="$0" pattern="1">
<page name="Page" bounds="0,0,827,1169" visible="false" margin="100,100,100,100" paperwidth="2100" paperheight="2969"/>
<sheet name="字线" bounds="80,36,228,164">
<line name="Line1" origin="168,138" linkmode="1">
<points>
80,36,6
228,164,2
</points>
<link>
Line2,P1,P0
Line3,P0,P0
</link>
</line>
<line name="Line3" origin="80,36" linkmode="3" points="80,36,6">
<programe>
Published Function OnNodeChange(Sender,Index)
ResetTexts()
End Function
</programe>
</line>
<line name="Line2" origin="228,164" linkmode="3" points="228,164,6">
<programe>
Published Function OnNodeChange(Sender,Index)
ResetTexts()
End Function
</programe>
</line>
<group name="Group1">
</group>
<programe>
Private Function Initialize(Sender)
FText=&quot;字线0&quot;
Flinew=0
Ftextjj=15
FTextFontColor=0
FTextLineColor=0
FYjName=&apos;字线&apos;
End Function
Private Function ResetTexts()
d=sqrt( sqr( Line1.Points[0].x - Line1.Points[1].x ) + sqr( Line1.Points[0].y - Line1.Points[1].y ) )
ag = PointToAngle( Line1.Points[1].x, Line1.Points[1].y, Line1.Points[0].x, Line1.Points[0].y )
Line1.lineColor=FTextLineColor

if Group1.UnitCount &gt; 0 then
	w = Group1.Units[0].Width
	n = int( d / ( w + Ftextjj-5 ) )
	while Group1.UnitCount &gt; n
		DeleteUnit( Group1.Units[0] )
	wend
else
	u = AddUnit( &quot;Text&quot;, Left, Top, 0, 0 )
  u.Text = FText
  u.AutoSize = true
  u.TextAlign = 0
  u.Border=0
  u.SetOrigin( u.Left, u.Top + u.Height / 2 )
	w = u.Width
        
	n = int( d / ( w + Ftextjj-5 ) )
  if n = 0 then
  	DeleteUnit( u )
	else
  	Group1.Add( u )
  end if
end if

while Group1.UnitCount &lt; n
	u = CopyUnit( Group1.Units[0] )
	Group1.Add( u )
wend
i = 0
while i &lt; n
  u=Group1.Units[i]
  u.fontColor =  FTextFontColor
  x = Line1.Points[0].x + ( Line1.Points[1].x - Line1.Points[0].x ) * i / n
  y = Line1.Points[0].y + ( Line1.Points[1].y - Line1.Points[0].y ) * i / n
  u.MoveTo( x-cos((ag-90)/360*6.28)*Flinew, y - Group1.Units[0].Height / 2+sin((ag-90)/360*6.28)*Flinew)
  u.Angle = ag
	i = i + 1
wend
End Function
Private Function setlinew(Avalue)
if Flinew &lt;&gt; Avalue then
  Flinew = Avalue
  ResetTexts()
end if  
End Function
Private Function SetText(AValue)
FText = AValue
while Group1.UnitCount &gt; 0
	DeleteUnit( Group1.Units[0] )
wend
ResetTexts()
End Function
Private Function SetTextFontColor(aValue)
if FTextFontColor &lt;&gt; AValue then
  FTextFontColor = AValue
  ResetTexts()
end if   
End Function
Private Function settextjj(AValue)
if Ftextjj &lt;&gt; AValue then
  Ftextjj = AValue
  ResetTexts()
end if  
End Function
Private Function SetTextLineColor(AValue)
if FTextLineColor &lt;&gt; AValue
  FTextLineColor = AValue
  ResetTexts()
end if   
End Function
Property Text read FText write SetText name 线上文字
Property TextFontColor read FTextFontColor write SetTextFontColor name 文字颜色 editor Color
Property textjj read Ftextjj write settextjj name 文字间距
Property TextLineColor read FTextLineColor write SetTextLineColor name 线颜色 editor Color
Property textlinew read Flinew write setlinew name 字与线距
Property YjName read FYjName name 元件标识 editor Cursor
</programe>
</sheet>
<sheet name="边缘线" bounds="80,36,216,160">
<line name="Line1" origin="168,138" linkmode="3">
<points>
80,36,6
216,160,2
</points>
<programe>
Published Function OnNodeChange(Sender,Index)
ResetLines()
End Function
</programe>
<link>
Line2,P0,P0
</link>
</line>
<line name="Line2" origin="80,36" linkmode="3" points="80,36,6">
<programe>
Published Function OnNodeChange(Sender,Index)
ResetLines()
End Function
</programe>
</line>
<group name="Group1">
</group>
<programe>
Private Function Initialize(Sender)
FLineInterval=12
FLineAngle=30
FLinelen=20
FLineZXJ=0
FLineColor=0
FYjName=&apos;边缘线&apos;
End Function
Property LineAngle read FLineAngle write setLineAngle name 线夹角
Property LineColor read FLineColor write SetLineColor name 线颜色 editor Color
Property LineInterval read FLineInterval write SetLineInterval name 线间距
Property LineLen read FLineLen write SetLineLen name 线长度
Property LineZXJ read FLineZXJ write SetLineZXJ name 直线距
Public Function ResetLines()
d=sqrt( sqr( Line1.Points[0].x - Line1.Points[1].x ) + sqr( Line1.Points[0].y - Line1.Points[1].y ) )
ag = PointToAngle( Line1.Points[1].x, Line1.Points[1].y, Line1.Points[0].x, Line1.Points[0].y )
Line1.LineColor=Flinecolor
if Group1.UnitCount &gt; 0 then
  w = Group1.Units[0].Width
  *w=FLineInterval
  n = int( d / ( w + FLineInterval ) )
  *n = int( d /  w  )
  while Group1.UnitCount &gt; n
    DeleteUnit( Group1.Units[0] )
  wend
else
  u = AddUnit( &quot;Line&quot;, Left, Top,0, FLinelen )
  u.SetOrigin( u.Left, u.Top + u.Height / 2 )
  w = u.Width
  *w=FLineInterval
  n = int( d / ( w + FLineInterval ) )
  *n = int( d /  w  )
  if n = 0 then
    DeleteUnit( u )
  else
    Group1.Add( u )
  end if
end if

while Group1.UnitCount &lt; n
  u = CopyUnit( Group1.Units[0] )
  Group1.Add( u )
  u.Visible = true
wend

  
i = 0
while i &lt; n
  u=Group1.Units[i]
  u.linecolor=Flinecolor
  x = Line1.Points[0].x + ( Line1.Points[1].x - Line1.Points[0].x ) * i / n
  y = Line1.Points[0].y + ( Line1.Points[1].y - Line1.Points[0].y ) * i / n
 * u.MoveTo( x, y - Group1.Units[0].Height / 2 )
  u.MoveTo( x-cos((ag-90)/360*6.28)*FlineZXJ, y - Group1.Units[0].Height / 2+sin((ag-90)/360*6.28)*FlineZXJ)

  *u.Angle = ag
  if FLineAngle=0 then
    u.Angle=ag+90
  else
   if FLineAngle=90 then
     u.Angle=ag
   else
    u.Angle=ag+FLineAngle
   end if 
  end if  
    
  i = i + 1
wend
End Function
Private Function setLineAngle(AValue)
 if FLineAngle&lt;&gt;AValue then
  FLineAngle=AValue
  ResetLines()
end if  
End Function
Private Function SetLineColor(AValue)
if FLineColor&lt;&gt;AValue then
  FLineColor=AValue
  ResetLines()
end if  
End Function
Private Function SetLineInterval(AValue)
if AValue &gt; 0 then
  FLineInterval=AValue
  ResetLines()
end if
End Function
Private Function SetLineLen(AValue)
if  FLineLen&lt;&gt;AValue then
  FLineLen=AValue
  while Group1.UnitCount &gt; 0
    DeleteUnit( Group1.Units[0] )
  wend
  ResetLines()
end if   
End Function
Private Function SetLineZXJ(AValue)
if FLineZXJ&lt;&gt;AValue then
  FLineZXJ=AValue
  ResetLines()
end if  
End Function
Property YjName read Fyjname name 元件标识 editor Cursor
</programe>
</sheet>
<sheet name="边缘线轮廓" bounds="72,80,296,204">
<line name="Line1" description="边缘线" origin="195,166">
<points>
72,80,6
296,80,2
296,204,2
120,204,2
72,108,2
</points>
</line>
</sheet>
<sheet name="三点弧" bounds="104,68,144,108">
<shape name="Arc1" type="Arc" bounds="104,68,144,108" origin="210,166" endangle="133.64456199" startangle="225"/>
<line name="Line1" origin="114,104" linkmode="1" points="109.731,102.049,6">
<programe>
Published Function OnNodeChange(Sender,Index)
r = sqrt( sqr( Line1.Points[0].x - Line2.Points[0].x ) + sqr( Line1.Points[0].y - Line2.Points[0].y ) )
if r = 0 then
	ox = ( Line1.Points[0].x + Line2.Points[0].x ) / 2
	oy = ( Line1.Points[0].y + Line2.Points[0].y ) / 2
	r = sqrt( sqr( Sender.Points[0].x - ox ) + sqr( Sender.Points[0].y - oy ) ) / 2
	Arc1.SetBounds( ox - r, oy - r, 2 * r, 2 * r )
	Arc1.StartAngle = PointToAngle( Line1.Points[0].x, Line1.Points[0].y, ox, oy )
	Arc1.EndAngle = PointToAngle( Line2.Points[0].x, Line2.Points[0].y, ox, oy )
else
  Line3.OnNodeChange(Line3,0)
end if
End Function
</programe>
</line>
<line name="Line2" origin="111.329065301,74.463508323" linkmode="1" points="110.329065301,73.463508323,6">
<programe>
Published Function OnNodeChange(Sender,Index)
Line1.OnNodeChange( Line1, 0 )
End Function
</programe>
</line>
<line name="Line3" origin="414.463508323,170.176696543" points="143.918,85.019,6">
<programe>
Published Function OnNodeChange(Sender,Index)
ox = ( Line1.Points[0].x + Line2.Points[0].x ) / 2
oy = ( Line1.Points[0].y + Line2.Points[0].y ) / 2
if ( Line2.Points[0].y - Line1.Points[0].y ) = 0 then
	k1 = 100000000000
else
	k1=-( Line2.Points[0].x - Line1.Points[0].x )/( Line2.Points[0].y - Line1.Points[0].y )
end if
b1=oy-k1*ox
ox = ( Line3.Points[0].x + Line2.Points[0].x ) / 2
oy = ( Line3.Points[0].y + Line2.Points[0].y ) / 2
if ( Line3.Points[0].y - Line2.Points[0].y ) = 0 then
	k2=100000000000
else
	k2=-( Line3.Points[0].x - Line2.Points[0].x )/( Line3.Points[0].y - Line2.Points[0].y )
end if
b2=oy-k2*ox
if k1 = k2 then
	ox = 1000
else
	ox=( b2 - b1 ) / ( k1 - k2 )
end if
oy = k1 * ox + b1
r = sqrt( sqr( Line3.Points[0].x - ox ) + sqr( Line3.Points[0].y - oy ) )
Arc1.SetBounds( ox - r, oy - r, 2 * r, 2 * r )
ag1 = PointToAngle( Line1.Points[0].x, Line1.Points[0].y, ox, oy )
ag2 = PointToAngle( Line2.Points[0].x, Line2.Points[0].y, ox, oy )
ag3 = PointToAngle( Line3.Points[0].x, Line3.Points[0].y, ox, oy )
if ag1 &lt; ag2 then
	if( ag3 &lt; ag1 ) or ( ag3 &gt; ag2 ) then
  	ag=ag2
    ag2=ag1
    ag1=ag
	end if
else if ag1 = ag2 then
else if ag3 &gt; ag1 then
else if ag3 &lt; ag2 then
else
	ag=ag2
  ag2=ag1
  ag1=ag
end if
Arc1.StartAngle = ag1
Arc1.EndAngle = ag2
End Function
</programe>
</line>
<programe>
Private Function Initialize(Sender)
End Function
</programe>
</sheet>
<sheet name="字弧" bounds="76,48,280,244">
<shape name="Arc1" type="Arc" bounds="76,48,280,244" origin="182,146" endangle="133.64456199" startangle="225"/>
<line name="Line1" origin="108,216" linkmode="1" points="106,216,6">
<programe>
Published Function OnNodeChange(Sender,Index)
r = sqrt( sqr( Line1.Points[0].x - Line2.Points[0].x ) + sqr( Line1.Points[0].y - Line2.Points[0].y ) )
if r = 0 then
	ox = ( Line1.Points[0].x + Line2.Points[0].x ) / 2
	oy = ( Line1.Points[0].y + Line2.Points[0].y ) / 2
	r = sqrt( sqr( Sender.Points[0].x - ox ) + sqr( Sender.Points[0].y - oy ) ) / 2
	Arc1.SetBounds( ox - r, oy - r, 2 * r, 2 * r )
	Arc1.StartAngle = PointToAngle( Line1.Points[0].x, Line1.Points[0].y, ox, oy )
	Arc1.EndAngle = PointToAngle( Line2.Points[0].x, Line2.Points[0].y, ox, oy )
else
  Line3.OnNodeChange(Line3,0)
end if
End Function
</programe>
</line>
<line name="Line2" origin="108,76" linkmode="1" points="107,75,6">
<programe>
Published Function OnNodeChange(Sender,Index)
Line1.OnNodeChange( Line1, 0 )
End Function
</programe>
</line>
<line name="Line3" origin="416,168" points="276,120,6">
<programe>
Published Function OnNodeChange(Sender,Index)
ResetTexts()
End Function
</programe>
</line>
<group name="Group1">
</group>
<programe>
Private Function Initialize(Sender)
FText=&quot;字弧0&quot;
End Function
Private Function ResetTexts()
ox = ( Line1.Points[0].x + Line2.Points[0].x ) / 2
oy = ( Line1.Points[0].y + Line2.Points[0].y ) / 2
if ( Line2.Points[0].y - Line1.Points[0].y ) = 0 then
	k1 = 100000000000
else
	k1=-( Line2.Points[0].x - Line1.Points[0].x )/( Line2.Points[0].y - Line1.Points[0].y )
end if
b1=oy-k1*ox
ox = ( Line3.Points[0].x + Line2.Points[0].x ) / 2
oy = ( Line3.Points[0].y + Line2.Points[0].y ) / 2
if ( Line3.Points[0].y - Line2.Points[0].y ) = 0 then
	k2=100000000000
else
	k2=-( Line3.Points[0].x - Line2.Points[0].x )/( Line3.Points[0].y - Line2.Points[0].y )
end if
b2=oy-k2*ox
if k1 = k2 then
	ox = 1000
else
	ox=( b2 - b1 ) / ( k1 - k2 )
end if
oy = k1 * ox + b1
r = sqrt( sqr( Line3.Points[0].x - ox ) + sqr( Line3.Points[0].y - oy ) )
Arc1.SetBounds( ox - r, oy - r, 2 * r, 2 * r )
ag1 = PointToAngle( Line1.Points[0].x, Line1.Points[0].y, ox, oy )
ag2 = PointToAngle( Line2.Points[0].x, Line2.Points[0].y, ox, oy )
ag3 = PointToAngle( Line3.Points[0].x, Line3.Points[0].y, ox, oy )
if ag1 &lt; ag2 then
	if( ag3 &lt; ag1 ) or ( ag3 &gt; ag2 ) then
  	ag=ag2
    ag2=ag1
    ag1=ag
	end if
else if ag1 = ag2 then
else if ag3 &gt; ag1 then
else if ag3 &lt; ag2 then
else
	ag=ag2
  ag2=ag1
  ag1=ag
end if
Arc1.StartAngle = ag1
Arc1.EndAngle = ag2
M_PI=3.14159265359
if ag2 &lt; ag1 then
	ag2 = ag2 + 360
end if
ag = ag2 - ag1
ln = ag / 360 * 2 * M_PI * r
if Group1.UnitCount &gt; 0 then
	w = Group1.Units[0].Width + 5
	n = int( ln / w )
	while Group1.UnitCount &gt; n
		DeleteUnit( Group1.Units[0] )
	wend
else
	u = AddUnit( &quot;Text&quot;, Left, Top, 0, 0 )
  u.Text = FText
  u.AutoSize = true
  u.TextAlign = 0
  u.Border=0
  u.SetOrigin( u.Left + u.Width, u.Top + u.Height / 2 )
	w = u.Width + 5
	n = int( ln / w )
  if n = 0 then
  	DeleteUnit( u )
	else
  	Group1.Add( u )
  end if
end if
while Group1.UnitCount &lt; n
	u = CopyUnit( Group1.Units[0] )
	Group1.Add( u )
  u.Visible = true
wend
delta = asin( w / 2 / r ) * 180 / M_PI
i = 0
theta = ag1
while i &lt; n
  u=Group1.Units[i]
  a = theta - 90
  x = ox + r * cos( theta * M_PI / 180 )
  y = oy - r * sin( theta * M_PI / 180 )
  u.MoveTo( x - Group1.Units[0].Width, y - Group1.Units[0].Height / 2 )
  u.Angle = a + delta
  theta=theta + ag / n
	i = i + 1
wend
End Function
Private Function SetText(AText)
FText = AText
while Group1.UnitCount &gt; 0
	DeleteUnit( Group1.Units[0] )
wend
ResetTexts()
End Function
Property Text read FText write SetText name 线上文字
</programe>
</sheet>
<sheet name="轴" bounds="100,88,132,120">
<element name="Element1" bounds="100,88,132,120" origin="118,104">
<shape name="Circle1" type="Circle" bounds="100,88,132,120" origin="116,100.5" pattern="1"/>
<text name="Text2" cursor="15" bounds="103.555555556,92,128.444444444,116.848484849" origin="112.943965517,93.12004662" border="$0" fontname="宋体" fontsize="16" wordwrap="false" multiline="false" readonly="false" text="A" calculate="false"/>
</element>
</sheet>
<sheet name="标高" bounds="92,80,203.173913043,108.060539351">
<element name="Element2" bounds="92,80,203.173913043,108.060539351" origin="136,91.29113924">
<text name="Text4" cursor="15" bounds="115.823530448,83.396276077,158.063735178,97.396276077" origin="101.862946313,58.249443971" autosize="true" border="$0" fontname="宋体" fontsize="14" fontcolor="$2000000" multiline="false" readonly="false" textalign="8" borderinterval="0" text="±0000" calculate="false"/>
<element name="Element1" bounds="92,98.119810164,203.173913043,108.060539351" origin="204,96.082278481">
<element name="等腰三角形1" type="等腰三角形" bounds="92,98.119810164,100.437305901,108.060539351" origin="94,112.119810164">
<line name="Line1" origin="154,187.119810164" pattern="1">
<points>
96.21865295,108.060539351,6
92,98.119810164,2
100.437305901,98.119810164,2
96.21865295,108.060539351,2
</points>
</line>
<text name="Text1" bounds="94.320259123,98.119810164,98.15220222,103.516206008" origin="93.75,85.119810164" border="$0" fontname="宋体" fontsize="16"/>
</element>
<line name="Line1" origin="204,93.119810164">
<points>
92,98.119810164,6
203.173913043,98.119810164,2
</points>
</line>
</element>
</element>
</sheet>
<sheet name="有向线" bounds="56,112,256,200">
<line name="Line1" origin="156,156" endarrow="1" linkmode="1">
<points>
56,112,6
256,200,2
</points>
</line>
</sheet>
<sheet name="水平线" bounds="28,73,338,73">
<line name="Line1" origin="183,73" protect="8">
<points>
28,73,6
338,73,2
</points>
</line>
</sheet>
<sheet name="垂直线" bounds="130,63,130,269">
<line name="Line1" origin="130,166" protect="4">
<points>
130,63,6
130,269,2
</points>
</line>
</sheet>
<sheet name="指示1" bounds="41,100,340,166" protect="64">
<line name="Line2" origin="41,166" linkmode="3" points="41,166,6">
<programe>
Published Function OnNodeChange(Sender)
;
End Function
</programe>
</line>
<text name="Text1" bounds="176,100,340,120" origin="176,90" autosize="true" border="$0" fontname="宋体" fontsize="16" textalign="24" text="请在这里输入指示文本"/>
<line name="Line1" origin="100,210" endarrow="1" linkmode="3">
<points>
41,166,6
170,105,2
</points>
<programe>
Published Function OnNodeChange(Sender,Index)
Text1.Left = Sender.Points[1].x
Text1.Top = Sender.Points[1].y - Text1.Height / 2
End Function
</programe>
<link>
Line2,P0,P0
</link>
</line>
</sheet>
<sheet name="指示2" bounds="32,150,261,170">
<line name="Line2" origin="41,166" protect="8" linkmode="3" points="32,160,6">
<programe>
Published Function OnNodeChange(Sender)
;
End Function
</programe>
</line>
<line name="Line1" origin="100,210" protect="8" endarrow="1" linkmode="3">
<points>
32,160,6
193,160,2
</points>
<programe>
Published Function OnNodeChange(Sender,Index)
Text1.Left = Sender.Points[1].x
End Function
</programe>
<link>
Line2,P0,P0
Text1,P1,Center
</link>
</line>
<text name="Text1" bounds="193,150,261,170" origin="193,140" autosize="true" border="$0" fontname="宋体" fontsize="16" textalign="24" text="指示文本"/>
</sheet>
<sheet name="连接线" bounds="32,32,168,32">
<line name="Line1" type="Link" origin="100,32" linkmode="1">
<points>
32,32,6
168,32,2
</points>
</line>
</sheet>
<sheet name="弹簧" bounds="0,0,17.502853268,62.554599798">
<line name="Line1" origin="-21.25930365,-8" linkmode="1">
<points>
0,31.277299899,6
3.500570654,0,2
10.501711961,62.554599798,2
17.502853268,31.277299899,2
</points>
<programe>
Published Function OnNodeChange(Sender)
h=Height/2
p1=Point(Sender.Points[0].x,Sender.Points[0].y)
Sender.ViewToClient( p1 )
Parent.ClientToView( p1 )
SetOrigin( p1.x, p1.y )
m=Sender.PointCount
p2=Point(Sender.Points[m-1].x,Sender.Points[m-1].y)
Sender.ViewToClient( p2 )
Parent.ClientToView( p2 )
dis=Sender.Points[1].x-Sender.Points[0].x
ln=Sender.Points[m-1].x-Sender.Points[0].x
n=round( ln / dis / 2 )
if n &lt; 4 then
  n = 4
end if
Sender.PointCount = n
x=Sender.Points[0].x + dis
y=Sender.Points[0].y
i=1
while i &lt; n
	if mod( i, 2 ) = 0 then
    Sender.Points[i].y = y + h
  else
    Sender.Points[i].y = y - h
  end if 
  Sender.Points[i].x = x
  x = x + dis * 2
  i=i+1
wend
Sender.Points[n-1].y = y
Angle=PointToAngle( p2.x, p2.y, p1.x, p1.y )
End Function
</programe>
</line>
<line name="Line2" origin="-67.25930365,16" linkmode="1" points="0,31.277299899,6">
<programe>
Published Function OnNodeChange(Sender)
p1=Point( Line1.Points[Line1.PointCount-1].x, Line1.Points[Line1.PointCount-1].y )
Line1.ViewToClient( p1 )
Parent.ClientToView( p1 )
SetOrigin( p1.x, p1.y )
p2=Point( Sender.Left, Sender.Top )
Sender.ViewToClient( p2 )
Parent.ClientToView( p2 )
Sender.Top = Line1.Points[0].y
Line1.SetBounds( Sender.Left, Line1.Top, Line1.Width - ( Sender.Left - Line1.Points[0].x ), Line1.Height )
Line1.Refresh()
Angle = PointToAngle( p2.x, p2.y, p1.x, p1.y )
End Function
</programe>
</line>
</sheet>
</vg>
