Public Function SetXRecord(ByVal DictName As String, ByVal Keyword As String, ByVal XRecordData) Dim pDict As AcadDictionary Dim pXRecord As AcadXRecord Dim XRecordType() As Integer Dim pLen As Integer Set pDict = ThisDrawing.Dictionaries.Add(DictName) Set pXRecord = pDict.AddXRecord(Keyword) pLen = UBound(XRecordData) ReDim XRecordType(pLen) As Integer For i = 0 To pLen Select Case VarType(XRecordData(i)) Case vbInteger, vbLong XRecordType(i) = 70 Case vbSingle, vbDouble XRecordType(i) = 40 Case vbString XRecordType(i) = 1 End Select Next i pXRecord.SetXRecordData XRecordType, XRecordData
End Function |