我想编个程序,实现通过SelectOnScreen选择块后对块的编辑以及对块的缩放
想请教以下各位专家,如下的问题:我想编个程序,实现通过SelectOnScreen选择块后对块的编辑以及对块的缩放,但调试时老出现问题:运行时错误‘424' 要求对象
程序如下:
Option Explicit
Public BlockObj As AcadObject '定义块
Dim BlockObjAttributes As Variant '定义属性
Dim i As Integer '定义循环变量
Public BlockName As String '定义块名称
Dim sset As AcadSelectionSet '定义sset对象
Dim handle As Variant
Private Sub CommandButton1_Click()
Me.Hide '退出窗体
On Error Resume Next
ThisDrawing.SelectionSets.Item("BlockEdit").Delete
Set sset = ThisDrawing.SelectionSets.Add("BlockEdit")
sset.SelectOnScreen '在屏幕上选择对象
Set BlockObj = ThisDrawing.HandleToObject(sset.Item(0).handle) '通过句柄获得块,获取与给定句柄对应的对象
BlockName = BlockObj.Name '获取块名称
BlockObjAttributes = BlockObj.GetAttributes '获取块属性
Me.Show '显示窗体
End Sub
Private Sub CommandButton2_Click()
Dim basePoint(0 To 2) As Double
Dim scalefactor As Double
basePoint(0) = 4: basePoint(1) = 4.25: basePoint(2) = 0
scalefactor = 0.5
BlockObj.ScaleEntity basePoint, scalefactor
End Sub
BlockObj.ScaleEntity basePoint, scalefactor 对象是否有问题? glacier272 发表于 2012-1-19 16:33 static/image/common/back.gif
BlockObj.ScaleEntity basePoint, scalefactor 对象是否有问题?
请高手解决下啊
页:
[1]