就拿你前面给我的代码做个测试,我测试的时候他告诉我类型不对,郁闷!你看看行不行,该不会是版本的问题。
Sub Example_SetXdata() ' This example creates a line and attaches extended data to that line. ' Create the line Dim lineObj As AcadLine Dim startPt(0 To 2) As Double, endPt(0 To 2) As Double startPt(0) = 1#: startPt(1) = 1#: startPt(2) = 0# endPt(0) = 5#: endPt(1) = 5#: endPt(2) = 0# Set lineObj = ThisDrawing.ModelSpace.AddLine(startPt, endPt) ZoomAll
Dim DataType(0 To 4) As Integer Dim Data(0 To 4) As Variant
DataType(0) = 1001: Data(0) = "testapp" DataType(1) = 1000: Data(1) = "a" DataType(2) = 1000: Data(2) = "b" DataType(3) = 1000: Data(3) = "c" DataType(4) = 1000: Data(4) = "d" ' Attach the xdata to the line lineObj.SetXData DataType, Data ' Return the xdata for the line Dim xdataOut As Variant Dim xtypeOut As Variant lineObj.GetXData "", xtypeOut, xdataOut End Sub
|