下列代码我想把用户输入的值加入到文本对象的1000延伸数据中,为什么不可以呢?错在哪里?
Sub ShuRu()<BR>Dim xhobj As AcadText<BR>Dim xuahao As Integer<BR>xuahao = ThisDrawing.Utility.GetString(1, vbCrLf & "序号:")<BR>Dim datatype(0 To 1) As Integer<BR>Dim data(0 To 1) As String<BR>datatype(0) = 1001: data(0) = "number"<BR>datatype(1) = 1000: data(1) = "xuhao"<BR>xhobj.SetXData datatype, data<BR>End Sub 帮助的代码没看仔细?
Dim Data(0 To 9) As Variant<BR> 改过来了,可是总是提示:运行错误91,对象变量或with块变量未设置。另外用insertblock插入在cad中做好的属性块,怎么做呀,做不出来,我按例子做的,如:在cad中作了一个btblock的属性块,在vba中插入:
Dim blkRefObj As AcadBlockReference<BR> Dim insertPnt(0 To 2) As Double<BR> insertPnt(0) = 120: insertPnt(1) = 100: insertPnt(2) = 0<BR> Set blkRefObj = ThisDrawing.ModelSpace.InsertBlock(insertPnt, _<BR> "btblock", 1#, 1#, 1#, 0#)<BR> blkRefObj.Update<BR> MsgBox ""<BR> ThisDrawing.Regen True
页:
1
[2]