Jump to content

Dwg Format to Visual basic


aykut66

Recommended Posts

hello dear friends,

i am working on a project of transforming the drawing.

I want to read the AutoCAD file in to VB program so that i can generate an equivalent drawing with the same co-ordinates.

For this i need to know the file format of AutoCAD drawing file which contains the co-ordinates of the lines,circles.etc( shapes). I want to learn initial and end positions of this shapes.

"How i can read the file of AutocAD with extension( .DWG ) into my VB program to get the exact values of the drawing objectsn( lines etc )

 

 

Please help me in this regard with your valuable knowledge and experience.

 

Best Regards,

Aykut

Kocaeli University

Link to comment
Share on other sites

I doubt that you will be able to decode a dwg file as it is basically a compressed database file, and I can't see AutoDesk releasing their compression algorithms easily. You will get a lot further if you start with a DXF file though as that is a text file which can be interpreted with a bit of time spent reading it.

Link to comment
Share on other sites

@aykut66

I read somewhere that with "ObjectDBX" you can get information from and even edit drawing without opening it.

here's a code snippet I put aside for when one day I'll get to struggle with this argument

 

dim sampleFilePath as string
dim dbx as axdbdocument
dim doc as acaddocument
dim partListRefIndex as integer

sampleFilePath = "somewhere/sample.dwg"
set dbx = new axdbdocument
set doc = thisDrawing

' Let's point both version to the same file
doc.open(sampleFilePath, READ_ONLY)
dbx.open(sampleFilePath)

 

I guess this could mean you don't even have to have Autocad installed!

hope this could help for a start

in that case, I'd gladly share your results

 

bye

Link to comment
Share on other sites

I'm confused... Reading this thread's title, and OP's posts I'm interpreting that you're after .NET code, but the code sample you posted looks like VBA... Which is you're after?

 

Visual Basic == VB.NET, Visual Basic for Applications == VBA

Link to comment
Share on other sites

I opened dwg format ın notepad and I realized that it is in binary code . but dxf formatted files are in good from that I need. ı thınk ıt wıll help me more. if you have some source code can you share wıth me? I want to start wıth it. thanks for all.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...