コード例 #1
0
ファイル: Thumbnailer.cs プロジェクト: 15831944/ArchivePDF
        public Thumbnailer(SldWorks sw, ArchivePDF.csproj.PathSet ps)
        {
            swApp    = sw;
            APathSet = ps;

            swFrame = (Frame)swApp.Frame();
            swModel = (ModelDoc2)swApp.ActiveDoc;
            swDraw  = (DrawingDoc)swModel;

            if (swApp == null)
            {
                throw new ThumbnailerException("I know you gave me the SW Application Object, but I dropped it somewhere.");
            }

            if (swDraw == null)
            {
                throw new ThumbnailerException("You must having a drawing document open.");
            }

            swView = GetFirstView(swApp);

            sourcePath = swView.GetReferencedModelName().ToUpper().Trim();

            if (!sourcePath.Contains("SLDASM"))
            {
                assmbly = false;
            }

            drawingPath = swModel.GetPathName().ToUpper().Trim();
        }
コード例 #2
0
ファイル: Redbrick.cs プロジェクト: kcjuntunen/Redbrick-Addin
 static public ArchivePDF.csproj.PathSet GeneratePathSet()
 {
     ArchivePDF.csproj.PathSet ps = new ArchivePDF.csproj.PathSet();
     ps.GaugePath          = Properties.Settings.Default.GaugePath;
     ps.ShtFmtPath         = Properties.Settings.Default.ShtFmtPath;
     ps.JPGPath            = Properties.Settings.Default.JPGPath;
     ps.KPath              = Properties.Settings.Default.KPath;
     ps.GPath              = Properties.Settings.Default.GPath;
     ps.MetalPath          = Properties.Settings.Default.MetalPath;
     ps.SaveFirst          = Properties.Settings.Default.SaveFirst;
     ps.SilenceGaugeErrors = Properties.Settings.Default.SilenceGaugeErrors;
     ps.ExportPDF          = Properties.Settings.Default.ExportPDF;
     ps.ExportEDrw         = Properties.Settings.Default.ExportEDrw;
     ps.ExportImg          = Properties.Settings.Default.ExportImg;
     ps.WriteToDb          = Properties.Settings.Default.EnableDBWrite;
     ps.Initialated        = true;
     return(ps);
 }
コード例 #3
0
ファイル: PDFArchiver.cs プロジェクト: 15831944/ArchivePDF
        //private Boolean shouldCheck = true;

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="sw">Requires a <see cref="SolidWorks.Interop.sldworks.SldWorks"/> type.</param>
        /// <param name="ps">Requires a <see cref="ArchivePDF.csproj.PathSet"/></param>
        public PDFArchiver(ref SldWorks sw, ArchivePDF.csproj.PathSet ps)
        {
            swApp    = sw;
            APathSet = ps;
            swModel  = (ModelDoc2)swApp.ActiveDoc;
            ModelDocExtension ex  = (ModelDocExtension)swModel.Extension;
            string            lvl = GetRev(ex);

            if (DocCheck())
            {
                if (swModel.GetType() != (int)swDocumentTypes_e.swDocDRAWING)
                {
                    throw new ExportPDFException("You must have a Drawing Document open.");
                }
                swDraw  = (DrawingDoc)swModel;
                swFrame = (Frame)swApp.Frame();

                swView      = GetFirstView(swApp);
                metal       = IsMetal(swView);
                sourcePath  = swView.GetReferencedModelName().ToUpper().Trim();
                drawingPath = swModel.GetPathName().ToUpper().Trim();

                if (sourcePath.Contains("SLDASM"))
                {
                    modelType = swDocumentTypes_e.swDocASSEMBLY;
                }
                else if (sourcePath.Contains("SLDPRT"))
                {
                    modelType = swDocumentTypes_e.swDocPART;
                }
                else
                {
                    modelType = swDocumentTypes_e.swDocNONE;
                }
            }
            else
            {
                MustSaveException e = new MustSaveException("The drawing has to be saved.");
                throw e;
            }
        }
コード例 #4
0
ファイル: Redbrick.cs プロジェクト: kcjuntunen/Redbrick-Addin
 public static ArchivePDF.csproj.PathSet GeneratePathSet()
 {
     ArchivePDF.csproj.PathSet ps = new ArchivePDF.csproj.PathSet();
       ps.GaugePath = Properties.Settings.Default.GaugePath;
       ps.ShtFmtPath = Properties.Settings.Default.ShtFmtPath;
       ps.JPGPath = Properties.Settings.Default.JPGPath;
       ps.KPath = Properties.Settings.Default.KPath;
       ps.GPath = Properties.Settings.Default.GPath;
       ps.MetalPath = Properties.Settings.Default.MetalPath;
       ps.SaveFirst = Properties.Settings.Default.SaveFirst;
       ps.SilenceGaugeErrors = Properties.Settings.Default.SilenceGaugeErrors;
       ps.ExportPDF = Properties.Settings.Default.ExportPDF;
       ps.ExportEDrw = Properties.Settings.Default.ExportEDrw;
       ps.ExportImg = Properties.Settings.Default.ExportImg;
       ps.WriteToDb = Properties.Settings.Default.EnableDBWrite;
       ps.Initialated = true;
       return ps;
 }