Link to home
Start Free TrialLog in
Avatar of stephenlecomptejr
stephenlecomptejrFlag for United States of America

asked on

Extracting Tool Palettes Properties similiar to extracting Block Properties? using ADT AutoCAD 2006.

I'm trying to extract an object's properties (like Room Number and Room Name) that originally resides in a Tool Palette.
I can click on the object and explode it which gives the following:

F_ROOMFINISHOBJECTS:NETFLOORAREA
F_ROOMFINISHOBJECTS:ROOMNUMBER
F_ROOMFINISHOBJECTS:RMNAME

The F_ is the initial of my architectural firm that I work with.
The ROOMFINISHOBJECTS is the actual object name.

And I'm trying to pull the NETFLOORAREA values along with ROOMNUMBER and RMNAME into a text file.

I've tried using ATTEXT and put in a template:

FKP_ROOMFINISHOBJECTS:NETFLOORAREA C048000
FKP_ROOMFINISHOBJECTS:ROOMNUMBER C048000
FKP_ROOMFINISHOBJECTS:RMNAME C048000

it didn't give me any info - 0 records.

So I tried:

NETFLOORAREA C048000
ROOMNUMBER C048000
RMNAME C048000

and that also gave me 0 records.

I haven't got to talk to you guys in awhile.  Ya'll were great at answering my questions in times past - hope you can help me with this one.  Please note this is ADT 2006 instead of the AutoCAD 2000 that I had used in the past.  Most of the block stuff was converted to the Tool Palettes.

Thanks.

Stephen
Avatar of gonzal13
gonzal13
Flag of United States of America image

You can export the attribute tag names and their values to excel from blocks
Avatar of stephenlecomptejr

ASKER

Thank you very much... but I really want to get the VBA code to do this programmatically.

That way I can do the reverse of importing adjusted data back in.
hey stephen,
are these blocks with attributes? I know you want vba, but if these are blocks with attributes a quick workaround would be to use the _eattext command. In 2006 it is a beefed up attributes extractor that alows you to extract them to a table in the dwg. You may be able to use that for what you need with out any vba.
Sorry I havent been able to help with the vba, so busy lately when lunch comes around I'm getting the heck outa here ;)

let us know if that helped at all.
not sure if this code will help you. but this is part of some code that I use in a form to extract title block info and put it in database. Not sure if this will help you but it may give you an idea how to extract that info using vba. The **.text parts refer to text boxes in my form, then I send the info from the form to the database. There is lots of other code to go with the database part of it. Anyhow take a look and see if this will help.

Private Sub getFilename_Click()
Dim AttArray As Variant
Dim obj As Object
Dim msg, Style, Title, Help, Ctxt, response, MyString
Dim BlkRef As AcadBlockReference
FILENAME.text = ThisDrawing.FullName
LAYOUT.text = ThisDrawing.ActiveLayout.NAME
On Error GoTo QUITAPP
For Each obj In ThisDrawing.paperspace
            If TypeOf obj Is AcadBlockReference Then
            Set BlkRef = obj
                If BlkRef.HasAttributes Then
                    AttArray = BlkRef.GetAttributes
                    For i = LBound(AttArray) To UBound(AttArray)
                    If AttArray(i).TagString = "TYPE_OF_DWG" Then
                       DESCRIPTION.text = AttArray(i).textString
                    End If
                    Next i
                    For i = LBound(AttArray) To UBound(AttArray)
                    If AttArray(i).TagString = "JOB_NUMBER" Then
                       
                        DWG_NO.text = AttArray(i).textString
                    End If
                    Next i
                    For i = LBound(AttArray) To UBound(AttArray)
                    If AttArray(i).TagString = "LOCATION" Then
                       
                        LOCATION.text = AttArray(i).textString
                    End If
                    Next i
                    For i = LBound(AttArray) To UBound(AttArray)
                    If AttArray(i).TagString = "ITEM_#/CODE" Then
                       
                        ITM_CODE.text = AttArray(i).textString
                    End If
                    Next i
                    For i = LBound(AttArray) To UBound(AttArray)
                    If AttArray(i).TagString = "LOCATION" Then
                       
                        LOCATION.text = AttArray(i).textString
                    End If
                    Next i
                   
                   
                End If
        End If
    Next
QUITAPP:
End Sub
hey stephen,
did you ever get anywhere on this one?
Hey Norrin - is there anyway I can convert the above code to give me the object name?  something that will print me a listing of all TypeOf for obj?  like:

On Error GoTo QUITAPP
For Each obj In ThisDrawing.paperspace
            Debug.Print obj.TypeOf

Next
I'm sure there is a way. Might have to send the typeof to a txt file or something like thay. I'll try to look at it when I can, been kinda hard to do any extra curricular stuff lately, but I'll try. ;)

did you ever get anywhere on your original question? when you say tool palettes you are talking about blocks that are pulled from tool palettes right?

did you try the attribute extractor to see if that will give you what you need?
yea - that's the thing that is so confusing.
People keep correcting me that they are objects not blocks that are being pulled from the tool palette.
And I don't think they (objects) pull up the same as blocks with attributes.
I'll try the attribute extractor sometime next week but I have before and it hasn't worked since its again not a block with attributes but rather an object assigned to a "space" with properties that I would like to assign to a database.
I really wish you had ADT 2006.

Thanks for your help - norrin thus far.
I appreciate all your replies.
ASKER CERTIFIED SOLUTION
Avatar of norrin_radd
norrin_radd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial