bill165 发表于 2010-10-18 20:06:00

[求助]如何获取PL线offset之后的面积?

&nbsp;<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left">Sub
Ch4_OffsetPolyline()</p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; ' </span>创建多段线</p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; Dim plineObj As
AcadLWPolyline</span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; Dim points(0 To 11) As
Double</span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; points(0) = 1: points(1) =
1</span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; points(2) = 1: points(3) =
2</span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; points(4) = 2: points(5) =
2</span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; points(6) = 3: points(7) =
2</span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; points(8) = 4: points(9) =
4</span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; points(10) = 4: points(11) =
1</span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; Set plineObj = ThisDrawing.ModelSpace.
_</span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
AddLightWeightPolyline(points)</span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; plineObj.Closed =
True</span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; ZoomAll</span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; ' </span>偏移多段线</p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; Dim offsetObj As
Variant</span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><span style="">&nbsp;&nbsp;&nbsp; offsetObj = plineObj.<font style="background-color: rgb(49, 106, 197);" color="#ffffff">Offset</font>(0.25)</span></p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left">ZoomAll</p>
<p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left">End
Sub</p><p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><br/></p><p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left"><br/></p><p class="MsoNormal" style="margin: 0cm="0cm"0cm="0cm"0pt; text-align: left;" align="left">只找到这样的代码,但如何获得偏移之后的面积呢?请各位前辈指点一下<br/></p>
页: [1]
查看完整版本: [求助]如何获取PL线offset之后的面积?