明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 594|回复: 1

Coordinate出错

[复制链接]
发表于 2015-6-15 14:45:24 | 显示全部楼层 |阅读模式
下面这段,在最后一句 Po = acc.Coordinate(0),总是出错   跳出  运行错误‘424’:要求对象 ,
调试了一下只要把Po = acc.Coordinate(0)这句注释掉就没有问题,确认了myset里有3个polyline,不知道为什么会出错。

Sub kk()
  Dim beginpoint(2) As Double
  Dim endpoint(2) As Double
  Dim aac As AcadEntity
  Dim Po As Variant
  Dim flag As Boolean
  Dim myset As AcadSelectionSet
  Dim filtertype(0) As Integer
  Dim filterdata(0) As Variant
  
  beginpoint(0) = 0: beginpoint(1) = 0
  endpoint(0) = 0: endpoint(1) = 100.1
   
flag = flase

For Each myset In ThisDrawing.SelectionSets
    If myset.Name = "drawletter" Then
       flag = True
       Exit For
    End If
Next

If flag = True Then
   myset.Delete
End If
  
Set myset = ThisDrawing.SelectionSets.Add("drawletter")
     filtertype(0) = 0
     filterdata(0) = "*POLYLINE"
     myset.Select acSelectionSetAll, , , filtertype, filterdata

  Set aac = myset.Item(1)
  Po = acc.Coordinate(0)
End Sub

发表于 2015-6-15 16:57:09 | 显示全部楼层
Po = acc.Coordinate(0)(0)
Po = acc.Coordinates(0)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-25 11:55 , Processed in 0.142088 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表