Reading data text entities from dwg into Excel worksheet

Reading data text entities from dwg into Excel worksheet

Anonymous
Not applicable
2,510 Views
5 Replies
Message 1 of 6

Reading data text entities from dwg into Excel worksheet

Anonymous
Not applicable
Hi all,
I tried to get entities using selectionset and filter and reading text entities
(text and bouding box) and get details from drawing into excel worksheet.
I'm looking for link to some library to be used with vba (or vb.net) to read
entities from dwg without document opening and acad application instaled...
How to read data from dwg file(version 2002) by vba or vb.net? Edited by: 22332233 on Feb 5, 2009 12:06 PM
0 Likes
2,511 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

You cannot access *.dwg file to get data from it
without Acad installed, unless you license ReadDwg (since the question you
asked, I do not think you would license RealDwg) from Autodesk.

 

If VBA means ACAD VBA, you have answered your own
question partly, VBA runs inside Acad, so you have Acad installed. If you use
VB.NET, you can either automated Acad via COM interop, or write COM-able .NET
DLL to be used in conjunction with Acad VBA.

 

Anyway, the "link to some library" is Acad itself:
get it installed.

 

As for get data from Acad drawing into Excel sheet
(*.xls), you may or may not need to have Excel installed, depending on what
method you use: automate Excel (so, Excel must be installed), or DAO/ADO/ADO.NET
access to data in *.xls file.

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi
all, I tried to get entities using selectionset and filter and reading text
entities (text and bouding box) and get details from drawing into excel
worksheet. I'm looking for link to some library to be used with vba (or
vb.net) to read entities from dwg without document opening and acad
application instaled... How to read data from dwg file(version 2002) by vba or
vb.net? Edited by: 22332233 on Feb 5, 2009 12:06 PM
0 Likes
Message 3 of 6

Anonymous
Not applicable
Thanks for your answer.
I thougt some library distributed with instaled acad application
or some viewer for using with vb6 (vba office) or vb.net, that could
be used on second computer, that haven't acad instaled, but can
share files of drawings and create extended list with data for browse
file details and to get information about sets of components stored
inside file, list without opening. Optionaly open file with associated
application on computer instaled or using some activex for view file.
I read about using voloview activex can view file by vb (or vba office).
I can write details to excel, text file or db on computer with acad
and others get extended data through it, but I thought read data
directly from files and create list details, then only check date last
writing list and update list with new saved or changed files.
How to read entities no acadapplication window creating, connect
some object with stored entities for read only under acad vba ?
Is posible to save acadtext.textstrings to some custom properties
with file and later read this created custom data no need acad ?
(Excel even has custom property connect through cell data)
Can I convert my files (vb utility) and read entities from dxf ?
I'm new in acad programing and need find the way...
I thought, there is right place for my questions...
Thaks for help
0 Likes
Message 4 of 6

Anonymous
Not applicable

You need to have Acad installed to read data in
drawing file. No other way around it. With some sort of drawing viewer, you can,
well, VIEW it, no access to the drawing's internal data.

 

If you have the DXF version of the drawing files,
of course you can parse it to get targeting data, in case you have no
problem to obtain the DXF version (someone must must Acad to export the drawing
file to DXF).


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Thanks
for your answer. I thougt some library distributed with instaled acad
application or some viewer for using with vb6 (vba office) or vb.net, that
could be used on second computer, that haven't acad instaled, but can share
files of drawings and create extended list with data for browse file details
and to get information about sets of components stored inside file, list
without opening. Optionaly open file with associated application on computer
instaled or using some activex for view file. I read about using voloview
activex can view file by vb (or vba office). I can write details to excel,
text file or db on computer with acad and others get extended data through it,
but I thought read data directly from files and create list details, then only
check date last writing list and update list with new saved or changed files.
How to read entities no acadapplication window creating, connect some object
with stored entities for read only under acad vba ? Is posible to save
acadtext.textstrings to some custom properties with file and later read this
created custom data no need acad ? (Excel even has custom property connect
through cell data) Can I convert my files (vb utility) and read entities from
dxf ? I'm new in acad programing and need find the way... I thought, there is
right place for my questions... Thaks for help
0 Likes
Message 5 of 6

Anonymous
Not applicable
you might have been thinking of objectdbx
0 Likes
Message 6 of 6

Anonymous
Not applicable
Thanks to cadger for recommendation, but I can't
get objectdbx reference.
I want to call ObjectDbx from Excel vba, no success.
I suppose that library should be registered together
with instaled acad application therefore first time
I tried get it using CreateObject without acad
and then with acad, but with no difference.
Must, must (as Norman wrote) have acad instaled
seems not to be quite enough. 🙂

Knows somebody, where I make a mistake?

Private Sub GetDbx()
Dim objAcad As AcadApplication
Set objAcad = CreateObject("AutoCAD.Application")
Dim objDoc As AcadDocument
For Each objDoc In objAcad.Documents
objDoc.Close False
Next

Dim objDbx As Object 'AXDB15Lib.AxDbDocument
Set objDbx = objAcad.GetInterfaceObject("ObjectDBx.AxDbDocument.15")
'New AXDB15Lib.AxDbDocument 'CreateObject("ObjectDBx.AxDbDocument.15")
objDbx.Open "D:\DRAWING.dwg"

Dim ent As AXDB15Lib.AcadEntity
For Each ent In objDbx.ModelSpace
Debug.Print TypeName(ent)
If TypeName(ent) = "AcadText" Then

End If
Next

objAcad.Quit
Set objDbx = Nothing
Set objAcad = Nothing
End Sub

I spent time to get some info, not found... 😞

ObjectDbx realy haven't any tool as so as
acadselectionset for filtering entities?

Thanks for your time
22332233
0 Likes