Attribute Extraction From Excel

Discussion in 'AutoCAD' started by ColinStapleton, Sep 17, 2003.

  1. Hi,
    I've read many of the documents on attribute extraction but that doesn't seem to be the problem in my code. I'm wondering if the doc object is set up correctly b/c i'm get "num objects in model space 0" and "num objects in paper space 0" and "in here" doesn't pop up. As you can probably guess I'm newbie and any help would be greatly appreciated.

    Thanks,
    Colin

    .
    ..
    ..
    If dwgFile <> "" Then
      acadApp.Documents.Add (dwgFile)
      Set acadDoc = acadApp.Documents.Item(1)
      acadDoc.Activate

    MsgBox "num objects in model space " & CStr(acadDoc.ModelSpace.Count)
      MsgBox "num objects in paper space " & CStr(acadDoc.PaperSpace.Count)

    Dim i As Integer
      For Each element In acadDoc.ModelSpace
        MsgBox "in here"
        If element.HasAttributes Then
          attrArray = element.GetAttributes
          For i = LBound(attrArray) To UBound(attrArray)
            MsgBox "Attribute Text String : " & attrArray(i).TextString
          Next
        End If
      Next
    End If
    ..
    ..
    ..
     
    ColinStapleton, Sep 17, 2003
    #1
  2. Your subject line seems to imply that you are coding from Excel.

    If so, check out the ExtAttr.xls file in the Acad "Samples" directory. It
    should help get you started.

    Gary
     
    Gary McMaster, Sep 17, 2003
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.