请问如何把函数中绘制的一条多线段的名称传回来
<p>我调用了Draw_Box_Center绘制了一条多线段,我想在函数外中使用该多线段,比如说调用该多线段的的Coordinate属性。</p><p>我的代码如下,运行时出现“参数不可选”的错误提示</p><p> Call Draw_Box_Center("body_back_1", "Body_Layer", start_center_point_X, start_center_point_Y, L1, H1)<br/> <br/> Dim point1(0 To 1) As Double <br/> point1(0) = Draw_Box_Center.Coordinate(0)(0)<br/> point1(1) = Draw_Box_Center.Coordinate(0)(1)</p><p>Public Function Draw_Box_Center(box_name, layer_name, center_point_X, center_point_Y, box_long, box_width)<br/>' Define the 2D polyline points<br/> Dim first_point_X As Double<br/> Dim first_point_Y As Double<br/> <br/> <br/> Dim points(0 To 9) As Double<br/> <br/> first_point_X = center_point_X - box_long / 2<br/> first_point_Y = center_point_Y - box_width / 2<br/> <br/> points(0) = first_point_X: points(1) = first_point_Y<br/> points(2) = first_point_X + box_long: points(3) = first_point_Y<br/> points(4) = first_point_X + box_long: points(5) = first_point_Y + box_width<br/> points(6) = first_point_X: points(7) = first_point_Y + box_width<br/> points(8) = first_point_X: points(9) = first_point_Y<br/> <br/> ' Create a lightweight Polyline object in model space<br/> Set box_name = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)</p><p><br/> Draw_Box_Center = box_name<br/> <br/> ' Set the layer of new circle to "ABC"<br/> box_name.layer = layer_name</p><p>End Function</p> <p>Public Function Draw_Box_Center(box_name, layer_name, center_point_X, center_point_Y, box_long, box_width) as string</p><p>Draw_Box_Center=box_name.objecthandle</p><p>end function</p> sealive发表于2007-6-2 9:01:00static/image/common/back.gifPublic Function Draw_Box_Center(box_name, layer_name, center_point_X, center_point_Y, box_long, box_width) as stringDraw_Box_Center=box_name.objecthandleend function<p>THANKS A LOT!!!</p><p>我用另一种方法实现了,</p><p>谢谢你的回答~~</p>
页:
[1]