Solved

wmf to dxf

Posted on 1998-08-12
2
691 Views
Last Modified: 2011-10-03
Anybody out there who knows how to convert a wmf to dxf file format using VB?
0
Comment
Question by:imby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Expert Comment

by:soeding
ID: 1468684
What is the dxf file format?
0
 
LVL 8

Accepted Solution

by:
Answers2000 earned 200 total points
ID: 1468685
I thought I answered this in General Graphics (for 30 points - thanks imby).  Here's the answer again (can I have 200 <g>!) with an addition for soeding

dxf = the data exchange format used to exchange data between CAD packages (vector graphics type of thin).  It's kind of ASCII records, although there's now a binary flavour.  Also a lot of graphics drawing packages now support it as in import or export format.

Anyway here's the repeat answer:


You have to write a substantial amount of code to do this.  Basically you'd have to step through the input file, play into some kind of memory structure and write it out bit by bit.  This will take a lot of time to write as both formats have a lot of complicated variation.

You can read up on WMF in the SDK documentation.  Be aware there are enhanced and win 3.1 formats.  Additionally there is a Xerox variant used in DTP which precedes the win 3.1 format with some additional crap.

You can read up on DXF in Chapter 19 of Graphics File Formats by Kay & Levine, Windcrest/McGraw-Hill 1995, ISBN 0-07-034025-0.  (it also has some on WMF too).

If you decide to write this code, I would suggest you don't do it in  VB.  WMF is a low level format (lots of bit manipulation).  It would be a good task for C or C++.  Stick the C code into DLL, ActiveX or OCX control, and then call it from VB.

However if you simply want to translate, use a trick: find a program (e.g. Halo, I think) which has a command line translator, and kick it off from VB.

Lead Tools also have an OCX which does graphics display and is supposed to support WMF & DXF.  I haven't tried it, but this may also be sufficient (you won't get source, but you can call it from your VB program)

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question