Hi Johan,
I saw this code from you
----------------------------------------------------------------------
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using System;
using System.IO;
using System.Windows.Forms;
namespace ToDWG.csproj
{
public partial class SolidWorksMacro
{
public SldWorks swApp;
public IModelDoc2 swModel;
public string folder;
public string[] files;
public string result;
public void Main()
{
FolderBrowserDialog fb = new FolderBrowserDialog();
if (fb.ShowDialog() == DialogResult.OK)
{
folder = fb.SelectedPath;
files = Directory.GetFiles(folder);
int errors = 0, warnings = 0;
foreach (string file in files)
{
FileInfo fi = new FileInfo(file);
if (fi.Extension.ToLower() == ".sldasm")
{
//Do Nothing
}
if (fi.Extension.ToLower() == ".sldprt")
{
//Do Nothing
}
if (fi.Extension.ToLower() == ".slddrw")
{
swModel = swApp.OpenDoc6(file, (int)swDocumentTypes_e.swDocDRAWING, (int)swOpenDocOptions_e.swOpenDocOptions_Silent, "", ref errors, ref warnings);
swModel.Extension.SaveAs(fi.Name.Remove(fi.Name.LastIndexOf(".")) + ".DWG", (int)swSaveAsVersion_e.swSaveAsCurrentVersion, (int)swSaveAsOptions_e.swSaveAsOptions_Silent, null, ref errors, ref warnings);
result += file + "\n";
swApp.QuitDoc(file);
}
}
swApp.SendMsgToUser2("Files saved to DWG: \n" + result, (int)swMessageBoxIcon_e.swMbInformation, 0);
}
}
}
}
-----------------------------------------------------------------------------------------------------
I'm new to writing SolidWorks programs and wanted to know how to setup the dev env. to run this program
I have .NET installed, SolidWorks 2009, visula studio Entp. on my system
I wanted to use this code to launch solidworks, read in a dwg from an input dir and save the pdf file generated using save as to a different directory
I'm trying to create a program that would run in the command prompt as,
genPDF.exe -i c:\dwgFiles\part1.slddwg -o c:\pdfFiles\
where,
i = input file
o= output file
I really appreciate all the guidance and help in undestanding how to resolve this.
Thanks again
Renni.