• 大小: 2.01MB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2023-10-03
  • 语言: C#
  • 标签: .net  Cad类库  

资源简介

网上下了几个都不是真正的破解,只好自己动手!压缩包内包含解密文件及一个c#winfrom读取dwg、dxf的示例,vs2010下测试通过,支持最新的cad2014格式,更多示例可从官方下载。

资源截图

代码片段和文件信息

#region (C) Wout Ware 2005-2007
//
// File: DxfViewExample.cs
//
// (c) 2005-2007 Wout Ware All Rights Reserved.
//
#endregion

using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;

using WW.Cad.base;
using WW.Cad.Drawing;
using WW.Cad.Drawing.GDI;
using WW.Cad.IO;
using WW.Cad.Model;
using WW.Math;
using Color = System.Drawing.Color;
using System.Collections.Generic;
using WW.Cad.Model.Entities;
using WW.Actions;
using WW.Cad.Model.Tables;
using WW.Cad.Model.objects;


namespace DxfViewExample {
    /// 
    /// A basic DXF viewer example.
    /// 

    public partial class DxfView : Form {
        private DxfModel model;
        private GDIGraphics3D gdiGraphics3D;
        private Bounds3D bounds;
        private Matrix4D modelTransform = Matrix4D.Identity;
        private double scaleFactor = 1d;
        private Matrix4D from2DTransform;
        private Vector3D translation = Vector3D.Zero;
        private bool mouseDown;
        private bool shiftPressed;
        private Point lastMouseLocation;
        private Point mouseClickLocation;
        public event EventHandler EntitySelected;
        
        public DxfView() {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //

            gdiGraphics3D = new GDIGraphics3D(GraphicsConfig.BlackBackgroundCorrectForBackColor);
            InitializeComponent();
        }
        
        private void CalculateTo2DTransform() {
            if (bounds != null) {
                Matrix4D to2DTransform = DxfUtil.GetScaleTransform(
                    bounds.Corner1
                    bounds.Corner2
                    bounds.Center
                    new Point3D(0d ClientSize.Height 0d)
                    new Point3D(ClientSize.Width 0d 0d)
                    new Point3D(ClientSize.Width / 2 ClientSize.Height / 2 0d)
                );
                gdiGraphics3D.To2DTransform = to2DTransform * modelTransform;
            }
        }
        
        protected override void onresize(EventArgs e) {
            base.onresize(e);
            CalculateTo2DTransform1();
            Invalidate();
        }
        
        protected override void OnPaint(PaintEventArgs e) {
            //if (this.toolStripButton4.Text == “高清显示“)
            //e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            ////else
            e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

            gdiGraphics3D.Draw(e.Graphics ClientRectangle);
        }

        protected override void onmousedown(MouseEventArgs e)
        {
            base.onmousedown(e);
            lastMouseLocation = e.Location;
            mouseClickLocation = e.Location;
            mouseDown = true;
            //shiftPressed = ModifierKeys == Keys.Shift

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    2654208  2015-01-26 22:29  WW.Cad.dll

     文件      85504  2015-01-26 22:16  WW.GL.dll

     文件     161280  2015-01-26 21:43  WW.Pdf.dll

     文件     506368  2015-01-26 22:46  WW.dll

     文件        144  2010-07-10 12:04  WinFormsViewDwg2013\app.config

     文件     200704  2011-10-06 12:12  WinFormsViewDwg2013\bin\ICSharpCode.SharpZipLib.dll

     文件      19787  2013-12-30 21:40  WinFormsViewDwg2013\bin\Image Example.dxf

     文件      27648  2015-01-27 09:32  WinFormsViewDwg2013\bin\WinFormsViewExample.exe

     文件        144  2010-07-10 12:04  WinFormsViewDwg2013\bin\WinFormsViewExample.exe.config

     文件      40448  2015-01-27 09:32  WinFormsViewDwg2013\bin\WinFormsViewExample.pdb

     文件      11592  2015-01-27 09:39  WinFormsViewDwg2013\bin\WinFormsViewExample.vshost.exe

     文件        144  2010-07-10 12:04  WinFormsViewDwg2013\bin\WinFormsViewExample.vshost.exe.config

     文件    2654208  2015-01-26 22:29  WinFormsViewDwg2013\bin\WW.Cad.dll

     文件     506368  2015-01-26 22:46  WinFormsViewDwg2013\bin\WW.dll

     文件      85504  2015-01-26 22:16  WinFormsViewDwg2013\bin\WW.GL.dll

     文件       7168  2013-06-04 17:04  WinFormsViewDwg2013\bin\WW.License.dll

     文件     161280  2015-01-26 21:43  WinFormsViewDwg2013\bin\WW.Pdf.dll

     文件      16408  2015-01-27 09:32  WinFormsViewDwg2013\DxfViewExample.cs

     文件       7138  2013-12-30 21:36  WinFormsViewDwg2013\DxfViewExample.Designer.cs

     文件      18579  2013-12-30 21:36  WinFormsViewDwg2013\DxfViewExample.resx

     文件       1278  2015-01-26 10:41  WinFormsViewDwg2013\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6033  2015-01-27 09:32  WinFormsViewDwg2013\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       9315  2015-01-27 09:32  WinFormsViewDwg2013\obj\Debug\DxfViewExample.DxfView.resources

     文件       4608  2013-12-23 10:23  WinFormsViewDwg2013\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件      27648  2015-01-27 09:32  WinFormsViewDwg2013\obj\Debug\WinFormsViewExample.exe

     文件      40448  2015-01-27 09:32  WinFormsViewDwg2013\obj\Debug\WinFormsViewExample.pdb

     文件        180  2015-01-27 09:32  WinFormsViewDwg2013\obj\Debug\WinFormsViewExample.Properties.Resources.resources

     文件       4943  2015-01-27 09:39  WinFormsViewDwg2013\obj\Debug\WinFormsViewExampleCS VS2010.csproj.FileListAbsolute.txt

     文件        984  2015-01-26 10:42  WinFormsViewDwg2013\obj\Debug\WinFormsViewExampleCS VS2010.csproj.GenerateResource.Cache

     文件      54994  2015-01-26 17:37  WinFormsViewDwg2013\obj\Debug\WinFormsViewExampleCS VS2010.csprojResolveAssemblyReference.cache

............此处省略20个文件信息

评论

共有 条评论