cart: empty [ Login ]

merging other images

1 
zekeman
4/14/2008 9:51 PM
Will the CADLIB allow me to merge other images? Specifically I need to merge WMF files into the dxf drawing that we are dynamically creating. The WMF files are drawings of our parts that we sale. If we can't merge the WMF then we could first convert the WMF to dxf I suppose. Can we merge existing dwg or dxf drawings into the dxf drawing that we are dynamically creating? Thanks
Wout
4/14/2008 10:03 PM
CadLib currently does not have any importers, so you'd have to write one yourself unfortunately (or hire yours truely to write one for you). CadLib does have a Clone method on all entity objects, so you could open another DXF file and clone its entities into another drawing. Wout
zekeman
4/15/2008 3:03 AM
Thanks for your reply. My customer has put me on hold on this for awhile so I'll have to proceed to finish other things at hand. I appreciate your offer of assistance and both be interested in whether the clone method would work. I hope that we can proceed soon and start by purchasing the software with some hope of a method however it won't be for a month or two and only if the customer decides to go with it. Curious though how to get help information on cloning but I'll get back to you. Thanks,
Wout
4/15/2008 11:40 AM
Take your time. If you search this forum on 'clone' there will be some examples, amongst which this one (from post http://www.woutware.com/forum/index.php?topic=90.0):
C# Code:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using WW.Cad.IO; using WW.Cad.Model; using WW.Cad.Model.Entities; namespace DxfViewExample {   /// <summary>   /// The main form with a property grid on the left   /// and a DXF view control on the right.   /// </summary>   public partial class MainForm : Form {     public MainForm(DxfModel model) {       InitializeComponent();       // Added by Clay *****************************************************************************       OpenFileDialog openFileDialog = new OpenFileDialog();       openFileDialog.FileName = 'choose source file';       openFileDialog.Filter = 'DXF|*.dxf';       if (openFileDialog.ShowDialog() == DialogResult.OK) {         DxfModel sourceModel = DxfReader.ReadDxf(openFileDialog.FileName);         foreach (DxfEntity sourceEntity in sourceModel.Entities) {           if (sourceEntity is DxfPolyline2D) {             model.Entities.Add(               (DxfEntity)sourceEntity.Clone(                 model,                 ReferenceResolutionType.CloneMissing               )             );           }         }       }       // Added by Clay *****************************************************************************       viewControl.Model = model;     }     private void viewControl_EntitySelected(object sender, EntityEventArgs e) {       propertyGrid.SelectedObject = e.Entity;     }   } }
Wout
1