当前位置: 首页 > news >正文

网站结构模板北京专业做网站设计公司

网站结构模板,北京专业做网站设计公司,多层分销网站建设,seo如何进行优化如下图所示,获取多个实体的最大包围盒,用红色线表示: 也可单独选圆的包围盒 部分代码如下: using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.Geometry; using A…

如下图所示,获取多个实体的最大包围盒,用红色线表示:

 也可单独选圆的包围盒

部分代码如下:

using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AcTools;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Colors;
using System.Runtime.CompilerServices;
using Wform = System.Windows.Forms;
using System.IO;
using System.Windows.Forms;
//using Excel = NetOffice.ExcelApi;namespace AcTools
{public class Class1{#region //Polyline pl = new Polyline(3);//pl.AddVertexAt(0, new Point2d(10, 2), 0, 0, 0); // 起点 //pl.AddVertexAt(1, new Point2d(30, 5), 0, 0, 0); // 起点 //pl.AddVertexAt(2, new Point2d(50, 25), 0, 0, 0); // 起点 //Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;//db.AddEntityToModeSpace(line);#endregion[CommandMethod("xx")]public void XX(){   var db = Z.db;/// 包围盒List<Entity> ents = db.SelectEntities<Entity>();List<double> lis = Getboxs(ents);Polyline pl = new Polyline();if (lis.Count == 0 ){Z.ed.WriteMessage("未选择对象!");return;}pl.AddVertexAt(0, new Point2d(lis[0], lis[1]),0,0,0);pl.AddVertexAt(1, new Point2d(lis[2], lis[1]), 0, 0, 0);pl.AddVertexAt(2, new Point2d(lis[2], lis[3]), 0, 0, 0);pl.AddVertexAt(3, new Point2d(lis[0], lis[3]), 0, 0, 0);pl.Closed = true;pl.ColorIndex = 1;db.AddEntityToModeSpace(pl);List< Point2d> pt = new List<Point2d> { new Point2d(lis[0]+1000, lis[1]+1000),new Point2d(lis[2]+1000, lis[1] + 1000),new Point2d(lis[2]+1000, lis[3] + 1000),new Point2d(lis[0]+1000, lis[3]+1000)};db.AddPolyLineToModeSpace(true, 0, pt.ToArray());db.Zoom();//var ed = Z.ed;#region// 声明数据库对象//Database db = HostApplicationServices.WorkingDatabase;//db.EraseAll();// db.AddTable(6,6);//db.Zoom();//List<Entity> ents = new List<Entity>();//for (int i = 0; i < 5; i++)//{//    Line line = new Line(Point3d.Origin, new Point3d(100 * i, 100, 0));//    ents.Add(line);//}//ObjectId oid = db.AddAttBlock("属性块1", ents, new Point3d(0, 100, 0), "图号", "图号内容:", "2024-100", 20);ObjectId oid = db.AddAttBlock("属性块2", ents,new Point3d(100,100,0),"tag2","提示","显示文本",10);ObjectId bid = db.InsertAttrBlock(oid, Point3d.Origin, 0, 1, 1, 1);//Dictionary<string,string> dic= new Dictionary<string,string> ();// dic.Add("tag2","修改后的值3");//bid.ChangeBlockAttr(dic);db.ChangeBlockColor(oid, 5);ObjectId bref = db.InsertAttrBlock(oid, new Point3d(200, 0, 0), 0, 1, 1, 1);oid.EraseBlock();bref.EraseEntity();// db.DataToTableDemo();//db.Zoom();db.Savefd();db.EraseBlockSelectonScreen();BlockData blockData = new BlockData();//db.TxtToDwg();//SaveFileDialog savefd;//DialogResult saveDlgRes;//db.Sfd(out savefd, out saveDlgRes);//if (saveDlgRes == Wform.DialogResult.OK)//{//    BlockData[] data = new BlockData[2];//    data[0].layerName = "0的图层名";//    data[1].blockName = "1的块名";//    string[] contents = new string[data.Length];//    for (int i = 0; i < data.Length; i++)//    {//        contents[i] = data[i].blockName + data[i].layerName + ",";//    }//    //string[] contents = new string[] { "1111", "dzb" };//    File.WriteAllLines(savefd.FileName, contents);// db.DwgToTxt();//db.TxtToDwg();//OpenFileDialog ofd = new OpenFileDialog();//DialogResult ofdr = ofd.ShowDialog();//db.Ofd(out ofd, out ofdr );//SaveFileDialog sfd;//= new SaveFileDialog();//DialogResult sfdr;//` = sfd.ShowDialog();//db.Sfd(out sfd, out sfdr);//db.DwgToTxt();//db.TxtToDwg();//Excel.Application excelAPP = new Excel.Application();//Excel.Workbook book  = excelAPP.Workbooks.Add() ;//Excel.Worksheet sheet = (Excel.Worksheet) book.Worksheets[0] ;// sheet.Cells["A1"].Value = "dzb";//excelAPP.Visible = true ;//excelAPP.Worksheets.Add(book) ;//excelAPP.Worksheets.Add(book);#endregion//db.DDwgToTxt();//  db.TxtToDwg();//ed.WriteMessage("1");}private List<double> Getboxs(List<Entity> entities){List< double> lis = new List< double>();if (entities.Count ==0){return lis;}double minx = entities.Min(x => x.Bounds.Value.MinPoint.X);double miny = entities.Min(x => x.Bounds.Value.MinPoint.Y);double maxx = entities.Max(x => x.Bounds.Value.MaxPoint.X);double maxy = entities.Max(x => x.Bounds.Value.MaxPoint.Y);lis.Add(minx);lis.Add(miny);lis.Add(maxx);lis.Add(maxy);return lis;}}
}
 public static List<T> SelectEntities<T>(this Database db) where T : Entity{List<T> result = new List<T>();Editor editor = Application.DocumentManager.MdiActiveDocument.Editor;PromptSelectionResult psr = editor.GetSelection();if (psr.Status == PromptStatus.OK){ObjectId[] objectids = psr.Value.GetObjectIds();Database database = HostApplicationServices.WorkingDatabase;using (Transaction tran = database.TransactionManager.StartTransaction()){foreach (var item in objectids){Entity entity = item.GetObject(OpenMode.ForRead) as Entity;if (entity is T){result.Add(entity as T);}}}}return result;}

http://www.yayakq.cn/news/224048/

相关文章:

  • 聊城网站建设网站建设吴江
  • 全屏网站模版汽车网站制作模板
  • 广州本地门户网站注册城乡规划师
  • 广东省高校质量工程建设网站北京天仪建设工程质量检测所网站6
  • 电商网站开发用什么软件好合肥建设监理协会网站
  • 新注册网站专业生产车间设计图纸网站
  • 做网站公司不给源代码软件工程考研学校推荐
  • 深圳创建网站网络营销的优势
  • 广告公司网站(附falsh及源代码)企业平台网
  • 视频网站建设的背景简介长岛网站建设费用
  • 厦门网站建设建设公司淘宝网络营销案例分析
  • 做pc端网站渠道青岛网页设计哪个公司好
  • 做推广网站那里好周村网站制作哪家好
  • asp.net mvc5网站开发只有一个域名怎么做网站
  • 烟台市牟平区建设局网站手机版商城网站都有哪 些功能
  • 什么是搜索引擎推广苏州关键词seo排名
  • 中外商贸网站建设想学网络运营怎么开始
  • 菲律宾 网站开发公司易语言做网站客户端
  • 网站运营一个月多少钱兰溪网站建设
  • 手机网站 制作计算机网络设计实验报告
  • 怎么判断一个网站做的好不好临沂网站建设对实体企业
  • 内部网站建设要求马可波罗网
  • android开发基础西安seo外包行者seo06
  • seo网站建设技巧设计公司网站要包含什么信息
  • 深圳住房和城乡建设局网站余杭区建设局网站
  • 简述如何优化网站的方法网络架构的设计依据是什么
  • 程序员做电商网站的公司好吗网站 禁止查看源码
  • 热门的网站模板下载遵化建设局网站
  • 计算机企业网站建设论文微信 网站提成方案点做
  • 2022恢复线下教学通知长沙 网站优化