Hi dlabreche,
The attached Word document has some code and comments which may prove
helpful.
Regards,
Laurie Comerford
dlabreche@gateprecast.com wrote:
> here is the code...I have also attached it as a text file { Sub
> d_takeoff() Dim ssetObj As AcadSelectionSet Dim blockObj As AcadBlock
> Dim i As Integer Dim attributeObj As AcadAttribute Dim blockRefObj As
> AcadBlockReference Dim strAttributes As String Dim varAttributes As
> Variant Dim ent As Variant Dim temp As String Dim objSelection As
> AcadSelectionSet Dim objSS As AcadSelectionSet Dim strSSList As String
> Dim name As String Dim objWork As Object Dim objAttribs As Collection
> Dim objent As AcadEntity Dim objBref As AcadBlockReference Dim
> varAttribs As Variant Dim strAttribs As String Dim intI As Integer Dim
> count As Integer Dim listOfAttributes(20) As String Dim panelMark As
> String 'Dim oAccess As New AD0DB.Connection Dim PanelCount As Integer
> Dim timeToStop As Boolean timeToStop = "False" Do With
> ThisDrawing.Utility Set ssetObj = ThisDrawing.SelectionSets.Add("1")
> ssetObj.SelectOnScreen count = 1 For Each ent In ssetObj Set objent =
> ent Set objBref = objent varAttribs = objBref.GetAttributes strAttribs =
> "Blockname: " & objBref.name & vbCrLf For intI = LBound(varAttribs) To
> UBound(varAttribs) strAttribs = strAttribs & " Tag(" & intI & "): " & _
> varAttribs(intI).TagString & vbTab & " value(" & intI & "): " & _
> varAttribs(intI).TextString & vbCrLf If varAttribs(intI).TagString =
> "MARK" Then listOfAttributes(0) = varAttribs(intI).TagString End If If
> varAttribs(intI).TagString = "D" Then listOfAttributes(count) =
> varAttribs(intI).TextString count = count + 1 End If Next MsgBox
> strAttribs Next ssetObj.Clear ssetObj.Delete End With Loop Until
> timeToStop oAccess.Open "Provider=Microsoft.Jet.OLEDB.4.0; & "Data
> Source=" & "C:\AutoCAD-VBA.mbd" & ";" oRecordset.Open "Select * from
> layers", oAccess, adOpenKeyset, adLockOptimistic End Sub}
>