当前位置: 首页>>代码示例>>C#>>正文


C# Building.Save方法代码示例

本文整理汇总了C#中Building.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Building.Save方法的具体用法?C# Building.Save怎么用?C# Building.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Building的用法示例。


在下文中一共展示了Building.Save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: drawRectBtn_Click

        //矩形绘制按钮
        public void drawRectBtn_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            //CommandManager.Register();
            if(!HeatSourceLayoutApp.CommandManager.RequireLock())
            {
                HeatSourceLayoutApp.CommandManager.AddCommand(CommandManager.ToolCommand.DrawBuildingRect);
                Application.DocumentManager.MdiActiveDocument.SendStringToExecute("\x1B", true, false, false);

                return;
            }
            else
            {
                changeBtnStyle(2);
            }
            Utility.SetOrthoMode(false);
            HeatSourceLayoutApp.solutionPanel.SelectOutLineLayer();
            using(DocumentLock docLock = Application.DocumentManager.MdiActiveDocument.LockDocument())
            {
                Database db = HostApplicationServices.WorkingDatabase;
                Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
                while (true)
                {
                    PromptPointOptions optPoint = new PromptPointOptions
                        ("\n请指定矩形的一个角点");
                    PromptPointResult resPoint = ed.GetPoint(optPoint);
                    if(HeatSourceLayoutApp.CommandManager.Status())
                    {
                        HeatSourceLayoutApp.CommandManager.ReleaseLock();
                        HeatSourceLayoutApp.CommandManager.TriggerCommand();
                        return;
                    }
                    if (resPoint.Status != PromptStatus.OK)
                    {
                        HeatSourceLayoutApp.CommandManager.ReleaseLock();
                        return;
                    }
                    Point3d pt1 = resPoint.Value;

                    Polyline polyLine2 = new Polyline();
                    for (int i = 0; i < 4; i++)
                    {
                        polyLine2.AddVertexAt(i, new Point2d(0, 0), 0, 0, 0);
                    }
                    polyLine2.Closed = true;

                    polyLine2.Color = Color.FromRgb(255, 0, 0);

                    RecJig elRecJig = new RecJig(pt1, polyLine2);

                    PromptResult resJig = ed.Drag(elRecJig);
                    if (resJig.Status == PromptStatus.OK)
                    {
                        if (elRecJig.m_PolyLine2.Area >= 1e-10)
                        {
                            ObjectId objid = AppendEntity(elRecJig.m_PolyLine2);
                            Building b = new Building(true);
                            b.BaseObjectId = objid;
                            HeatSource.HeatSourceLayoutApp.buildings.Add(objid, b);
                            //b.AddBuildingNumber();
                            b.Save();
                        }
                    }
                }
            }
        }
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:66,代码来源:ToolPanel.xaml.cs

示例2: drawBuildingBtn_Click

        //绘制楼房按钮
        public void drawBuildingBtn_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (!HeatSourceLayoutApp.CommandManager.RequireLock())
            {
                HeatSourceLayoutApp.CommandManager.AddCommand(CommandManager.ToolCommand.DrawBuildingPoly);
                Application.DocumentManager.MdiActiveDocument.SendStringToExecute("\x1B", true, false, false);
                return;
            }
            else
            {
                changeBtnStyle(1);
            }
            Utility.SetOrthoMode(false);
            while (true) {
                HeatSourceLayoutApp.solutionPanel.SelectOutLineLayer();

                bool status = false;
                ObjectId objId = Utils.MyPlineCmds.MyPolyJig(out status);
                if(HeatSourceLayoutApp.CommandManager.Status())
                {
                    HeatSourceLayoutApp.CommandManager.ReleaseLock();
                    HeatSourceLayoutApp.CommandManager.TriggerCommand();
                    break;
                }
                if(status == false)
                {
                    //CommandManager.UnRegister();
                    HeatSourceLayoutApp.CommandManager.ReleaseLock();
                    break;
                }
                if (objId != ObjectId.Null)
                {
                    Building b = new Building(true);
                    b.BaseObjectId = objId;
                    b.Save();
                    HeatSourceLayoutApp.buildings.Add(objId, b);
                }
            }
        }
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:40,代码来源:ToolPanel.xaml.cs


注:本文中的Building.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。