我调用了Draw_Box_Center绘制了一条多线段,我想在函数外中使用该多线段,比如说调用该多线段的的Coordinate属性。 我的代码如下,运行时出现“参数不可选”的错误提示 Call Draw_Box_Center("body_back_1", "Body_Layer", start_center_point_X, start_center_point_Y, L1, H1) Dim point1(0 To 1) As Double point1(0) = Draw_Box_Center.Coordinate(0)(0) point1(1) = Draw_Box_Center.Coordinate(0)(1) Public Function Draw_Box_Center(box_name, layer_name, center_point_X, center_point_Y, box_long, box_width) ' Define the 2D polyline points Dim first_point_X As Double Dim first_point_Y As Double Dim points(0 To 9) As Double first_point_X = center_point_X - box_long / 2 first_point_Y = center_point_Y - box_width / 2 points(0) = first_point_X: points(1) = first_point_Y points(2) = first_point_X + box_long: points(3) = first_point_Y points(4) = first_point_X + box_long: points(5) = first_point_Y + box_width points(6) = first_point_X: points(7) = first_point_Y + box_width points(8) = first_point_X: points(9) = first_point_Y ' Create a lightweight Polyline object in model space Set box_name = ThisDrawing.ModelSpace.AddLightWeightPolyline(points) Draw_Box_Center = box_name ' Set the layer of new circle to "ABC" box_name.layer = layer_name
End Function |