Hello all,
I know this might be a long shot, but has anyone of you used C# to program Solidworks eDrawings control?
I am having trouble using the provided Print2 function in the eDrawings API. I emailed Solidworks, but their response team is very slow, the last reply about another issue was like 5 days. So I was hoping if anyone can take a look at my code and tell me what is wrong?
Thanks!
Ke
-----------------------------------------------------------------------
-------------------------------
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Printing;
namespace OmegaDyne_Document_Controller { public partial class eDrawingsWindow : Form { public eDrawingsWindow() { InitializeComponent(); }
private void eDrawingsWindow_Load(object sender, EventArgs e) { //Retrives the path of the drawings file. string docFullPath = Document.FullPath;
//Selects the View or Print action according to the value passed from the main form. if (eDrawingsOption.pvOption == "view") { axEModelViewControl1.OpenDoc(docFullPath, false, false, true, ""); } if (eDrawingsOption.pvOption == "print") { axEModelViewControl1.OpenDoc(docFullPath, false, false, true, "");
axEModelViewControl1.SetPageSetupOptions(EModelView.EMVPrintOrientation .ePortrait, 1, 0, 0, 1, 7, "hp color LaserJet 2550 PCL 6", 1, 1, 1,
1);axEModelViewControl1.Print2(false, docFullPath, false, false, false, EModelView.EMVPrintType.eOneToOne); } }
} }