Revit二次开发——选集

2023-10-27


选集

选择图元后运行外部命令获取选择的内容

Revit API中定义了单选、多选、框选等方式的用户选集,用户可以十分方便的使用鼠标和键盘完成这三种方式的图元选择。Revit API根据三种用户选集各自的特点,封装了多种实现的重载。

using System;
using System.Collections.Generic;
using System.IO;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;

namespace HelloRevitSelection
{
    [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
    public class SelectionElementSetCmd : IExternalCommand
    {
        public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            try
            {
                UIDocument uidoc = commandData.Application.ActiveUIDocument;
                Selection selection = uidoc.Selection;
                ICollection<ElementId> selectSet = selection.GetElementIds();

                if (0 == selectSet.Count)
                {
                    TaskDialog.Show("选集", "没有选择任何元素.");
                }
                else
                {
                    string info = "当前文档的用户选集的元素Id为: ";
                    foreach (ElementId id in selectSet)
                    {
                        info += "\n\t" + id.IntegerValue;
                    }

                    TaskDialog.Show("选集", info);
                }

                return Autodesk.Revit.UI.Result.Succeeded;
            }
            catch(Exception ex)
            {
                message = ex.Message;
                return Autodesk.Revit.UI.Result.Failed;
            }


        }
    }
}

用户选集

Selection类还有一些允许用户选择新对象,甚至屏幕上一个点的方法。这让用户可以使用光标选择一 个或多个图元(或其他对象,如边或面),然后将控制返回给应用程序。这些功能并不自动向活动选择集添加新的选择。
●PickObject( )方法提示用户选择一个Revit模型中的对象。
●PickObjects( )方法提示用户选择多个Revit模型中的对象。
●PickElementsByRectangle( )方法提示用户用矩形选择多个Revit模型中的对象。
●PickPoint( )方法提示用户在活动草图平面内拾取一个点。
PickBox( )方法调用一个通用的双击编辑器,让用户在屏幕上指定一个矩形区域。调用PickObject( )或PickObjcts( )时即指定了需选对象的类型。可指定的对象类型有图元和图元上的点、边或面。每个Pick函数都可被重载,重载时可以带一个字符串参数,该参数用于定制状态栏消息


public Reference PickObject(ObjectType objectType);
public Reference PickObject(ObjectType objectType, string statusPrompt);
public Reference PickObject(ObjectType objectType, ISelectionFilter selectionFilter);
public Reference PickObject(ObjectType objectType, ISelectionFilter selectionFilter, string statusPrompt);
public IList<Reference> PickObjects(ObjectType objectType, string statusPrompt);
public IList<Reference> PickObjects(ObjectType objectType, ISelectionFilter selectionFilter);
public IList<Reference> PickObjects(ObjectType objectType, ISelectionFilter selectionFilter, string statusPrompt);
public IList<Reference> PickObjects(ObjectType objectType, ISelectionFilter selectionFilter, string statusPrompt, IList<Reference> pPreSelected);
public IList<Reference> PickObjects(ObjectType objectType);
public XYZ PickPoint();
public XYZ PickPoint(ObjectSnapTypes snapSettings);
public XYZ PickPoint(string statusPrompt);
public XYZ PickPoint(ObjectSnapTypes snapSettings, string statusPrompt);

单选

using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;

namespace HelloRevitSelection
{
    [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
    public class SinglePickCmd : IExternalCommand
    {
        public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            try
            {
                UIDocument uidoc = commandData.Application.ActiveUIDocument;
                Document doc = uidoc.Document;
                Selection selection = uidoc.Selection;

				//在revit当前文档下,进行选择元素的操作
                Reference eleRef = selection.PickObject(ObjectType.Element);

                // 对用户单选有效性进行验证
                if (null != eleRef && ElementId.InvalidElementId != eleRef.ElementId)
                {
                	//获取直接选择的这个元素
                    Element element = doc.GetElement(eleRef.ElementId);
                    TaskDialog.Show("单选", 
                        string.Format("图元:{0}\nID:{1}\n 坐标:{2}", element.Name, element.Id, eleRef.GlobalPoint));
                }

                return Autodesk.Revit.UI.Result.Succeeded;
            }
            catch(Exception ex)
            {
                message = ex.Message;
                return Autodesk.Revit.UI.Result.Failed;
            }
        }
    }

}

点选获取坐标

public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            try
            {
                UIDocument uidoc = commandData.Application.ActiveUIDocument;
                Document doc = uidoc.Document;

                Selection selection = uidoc.Selection;
                string msg = string.Empty;
                //点选获取坐标
                XYZ xyz = selection.PickPoint();
                msg = xyz.ToString();
                TaskDialog.Show(this.GetType().Name, msg);

                //AnnotationSymbol
                return Result.Succeeded;
            }
            catch (Exception ex)
            {
                message = ex.Message;
                return Result.Failed;
            }
        }

ObjectType
在这里插入图片描述

过滤的用户选集

PickObject()、PickObjects( )和PickElementsByRectangle( )都有一一 个以ISelectionFilter作为参数的重载。ISelectionFilter是一一个接口, 在选集操作期间,可用此接口实现过滤对象。它有两个可以重载的方法: AllowElement()用 于指定是否允许选择某个图元,AllowReference( )用于指定是否允许选择对某个几何体的参照。

ISelectionFilter接口

using Autodesk.Revit.DB;

namespace Autodesk.Revit.UI.Selection
{
    public interface ISelectionFilter
    {
        bool AllowElement(DB.Element elem);
        bool AllowReference(Reference reference, XYZ position);
    }
}

一个例子·

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;

namespace DemoFilterUserSelections
{

    [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
    public class DemoFilterSelection : IExternalCommand
    {
        public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            try
            {
                //句柄
                UIDocument uidoc = commandData.Application.ActiveUIDocument;
                //文档
                Document doc = uidoc.Document;
                //获取选择的图元集合
                Selection selection = uidoc.Selection;
                string msg = string.Empty;

                ISelectionFilter wallFilter = new WallSelectionFilter();

                //获取用户选集
                IList<Reference> eleRefs = selection.PickObjects(ObjectType.Element,wallFilter);

                if (0 == eleRefs.Count)
                {
                    TaskDialog.Show("过滤的用户选集", "用户没有选择图元");
                }
                else
                {
                    foreach (Reference eleRef in eleRefs)
                    {
                        //获取这个元素
                        Element element = doc.GetElement(eleRef.ElementId);
                        msg += "图元:" + element.Name + "ID:" + element.Id + "坐标:" + eleRef.GlobalPoint+"\n";
                    }
                    TaskDialog.Show("过滤的用户选集", msg);
                }


                return Autodesk.Revit.UI.Result.Succeeded;
            }
            catch (Exception ex)
            {
                message = ex.Message;
                return Autodesk.Revit.UI.Result.Failed;
            }







        }
    }


    //新建一个WallSelectionFilter类,实现ISelectionFilter接口
    public class WallSelectionFilter : ISelectionFilter
    {
        //方法:允许什么样的元素被选择
        public bool AllowElement(Element elem)
        {
            return elem is Wall;
        }

        //方法:否允许选择对某个几何体的参照,即是否允许引用
        public bool AllowReference(Reference reference, XYZ position)
        {
            return false;  //设置为不允许
        }
    }


}

SDK的例子

//
// (C) Copyright 2003-2019 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Autodesk.Revit;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;

namespace Revit.SDK.Samples.Selections.CS
{
    /// <summary>
    /// A default filter.
    /// All objects are allowed to be picked.
    /// </summary>
    public class DefaultElementsFilter : ISelectionFilter
    {
        /// <summary>
        /// Allow all the element to be selected
        /// </summary>
        /// <param name="element">A candidate element in selection operation.</param>
        /// <returns>Return true to allow the user to select this candidate element.</returns>
        public bool AllowElement(Element element)
        {
            return true;
        }

        /// <summary>
        /// Allow all the reference to be selected
        /// </summary>
        /// <param name="refer">A candidate reference in selection operation.</param>
        /// <param name="point">The 3D position of the mouse on the candidate reference.</param>
        /// <returns>Return true to allow the user to select this candidate reference.</returns>
        public bool AllowReference(Reference refer, XYZ point)
        {
            return true;
        }
    }

    /// <summary>
    /// A Filter for Wall Face.
    /// Only wall faces are allowed to be picked.
    /// </summary>
    public class WallFaceFilter : ISelectionFilter
    {
        // Revit document.
        Document m_doc = null;

        /// <summary>
        /// Constructor the filter and initialize the document.
        /// </summary>
        /// <param name="doc">The document.</param>
        public WallFaceFilter(Document doc)
        {
            m_doc = doc;
        }

        /// <summary>
        /// Allow wall to be selected
        /// </summary>
        /// <param name="element">A candidate element in selection operation.</param>
        /// <returns>Return true for wall. Return false for non wall element.</returns>
        public bool AllowElement(Element element)
        {
            return element is Wall;
        }

        /// <summary>
        /// Allow face reference to be selected
        /// </summary>
        /// <param name="refer">A candidate reference in selection operation.</param>
        /// <param name="point">The 3D position of the mouse on the candidate reference.</param>
        /// <returns>Return true for face reference. Return false for non face reference.</returns>
        public bool AllowReference(Reference refer, XYZ point)
        {
            GeometryObject geoObject = m_doc.GetElement(refer).GetGeometryObjectFromReference(refer);
            return geoObject != null && geoObject is Face;
        }
    }

    /// <summary>
    /// A Filter for planar face.
    /// Only planar faces are allowed to be picked.
    /// </summary>
    public class PlanarFaceFilter : ISelectionFilter
    {
        // Revit document.
        Document m_doc = null;

        /// <summary>
        /// Constructor the filter and initialize the document.
        /// </summary>
        /// <param name="doc">The document.</param>
        public PlanarFaceFilter(Document doc)
        {
            m_doc = doc;
        }

        /// <summary>
        /// Allow all the element to be selected
        /// </summary>
        /// <param name="element">A candidate element in selection operation.</param>
        /// <returns>Return true to allow the user to select this candidate element.</returns>
        public bool AllowElement(Element element)
        {
            return true;
        }

        /// <summary>
        /// Allow planar face reference to be selected
        /// </summary>
        /// <param name="refer">A candidate reference in selection operation.</param>
        /// <param name="point">The 3D position of the mouse on the candidate reference.</param>
        /// <returns>Return true for planar face reference. Return false for non planar face reference.</returns>
        public bool AllowReference(Reference refer, XYZ point)
        {
            GeometryObject geoObject = m_doc.GetElement(refer).GetGeometryObjectFromReference(refer);
            return geoObject != null && geoObject is PlanarFace;
        }
    }
}

//
// (C) Copyright 2003-2019 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Autodesk.Revit;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Reference = Autodesk.Revit.DB.Reference;
using Exceptions = Autodesk.Revit.Exceptions;

namespace Revit.SDK.Samples.Selections.CS
{
    /// <summary>
    /// A enum class for specific selection type.
    /// </summary>
    public enum SelectionType
    {
        /// <summary>
        /// type for select element.
        /// </summary>
        Element,
        /// <summary>
        /// type for select face.
        /// </summary>
        Face,
        /// <summary>
        /// type for select edge.
        /// </summary>
        Edge,
        /// <summary>
        /// type for select point.
        /// </summary>
        Point
    }

    /// <summary>
    /// A class for object selection and storage.
    /// </summary>
    public class SelectionManager
    {
        /// <summary>
        /// To store a reference to the commandData.
        /// </summary>
        ExternalCommandData m_commandData;
        /// <summary>
        /// store the application
        /// </summary>
        UIApplication m_application;
        /// <summary>
        /// store the document
        /// </summary>
        UIDocument m_document;
        /// <summary>
        /// For basic creation.
        /// </summary>
        Autodesk.Revit.Creation.ItemFactoryBase m_CreationBase;
        /// <summary>
        /// The picked point of element.
        /// </summary>
        XYZ m_elemPickedPoint;
                
        SelectionType m_selectionType = SelectionType.Element;
        /// <summary>
        /// For specific selection type.
        /// </summary>
        public SelectionType SelectionType
        {
            get 
            { 
                return m_selectionType; 
            }
            set 
            { 
                m_selectionType = value; 
            }
        }

        Element m_selectedElement;
        /// <summary>
        /// Store the selected element.
        /// </summary>
        public Element SelectedElement
        {
            get
            { 
                return m_selectedElement;
            }
            set 
            { 
                m_selectedElement = value; 
            }
        }

        XYZ m_selectedPoint;
        /// <summary>
        /// Store the selected point. 
        /// When the point is picked, move the element to the point.
        /// </summary>
        public XYZ SelectedPoint
        {
            get 
            { 
                return m_selectedPoint; 
            }
            set 
            { 
                m_selectedPoint = value; 
                if (m_selectedElement != null && m_selectedPoint != null)
                {
                    MoveElement(m_selectedElement, m_selectedPoint);
                }
            }
        }       

        /// <summary>
        /// constructor of SelectionManager
        /// </summary>
        /// <param name="commandData"></param>
        public SelectionManager(ExternalCommandData commandData)
        {
            m_commandData = commandData;
            m_application = m_commandData.Application;
            m_document = m_application.ActiveUIDocument;

            if (m_document.Document.IsFamilyDocument)
            {
                m_CreationBase = m_document.Document.FamilyCreate;
            }
            else
            {
                m_CreationBase = m_document.Document.Create;
            }
        }

        /// <summary>
        /// Select objects according to the selection type.
        /// </summary>
        public void SelectObjects()
        {
            switch (m_selectionType)
            {
                case SelectionType.Element:
                    PickElement(); // pick element
                    break;
                case SelectionType.Face:
                    break;
                case SelectionType.Edge:
                    break;
                case SelectionType.Point:
                    PickPoint(); // pick point
                    break;
            }
        }

        /// <summary>
        /// Pick the element from UI.
        /// </summary>
        internal void PickElement()
        {
            try
            {
                // Pick an element.
                Reference eRef = m_document.Selection.PickObject(Autodesk.Revit.UI.Selection.ObjectType.Element, "Please pick an element.");
                if (eRef != null && eRef.ElementId != ElementId.InvalidElementId)
                {
                    SelectedElement = m_document.Document.GetElement(eRef);
                    m_elemPickedPoint = eRef.GlobalPoint;
                }
            }
            catch (Exceptions.OperationCanceledException)
            {
                // Element selection cancelled.
                SelectedElement = null;
            }
        }

        /// <summary>
        /// Pick the point from UI.
        /// </summary>
        internal void PickPoint()
        {
            try
            {
                // Pick a point.
                XYZ targetPoint = m_document.Selection.PickPoint("Please pick a point.");
                SelectedPoint = targetPoint;
            }
            catch (Exceptions.OperationCanceledException)
            {
                // Point selection cancelled.
                SelectedPoint = null;
            }
        }

        /// <summary>
        /// Move an element to the point.
        /// </summary>
        /// <param name="elem">The element to be moved.</param>
        /// <param name="targetPoint">The location element to be moved.</param>
        internal void MoveElement(Element elem, XYZ targetPoint)
        {
            XYZ vecToMove = targetPoint - m_elemPickedPoint;
            m_elemPickedPoint = targetPoint;
            ElementTransformUtils.MoveElement(m_document.Document,elem.Id, vecToMove);
        }
    }
}

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Revit二次开发——选集 的相关文章

  • 如何使用 ASP.NET MVC 进行 HTTP 调用?

    我正在尝试做的事情 我试图练习进行 HTTP 调用 如果这就是它的名字 来自一个简单的 ASP NET MVC Web 应用程序 为此 我尝试从以下位置获取天气详细信息打开天气地图 http openweathermap org appid
  • 用 C# 启动 Windows 服务

    我想启动一个刚刚安装的Windows服务 ServiceBase ServicesToRun if bool Parse System Configuration ConfigurationManager AppSettings RunSe
  • 同步执行异步函数

    我对此主题进行了大量搜索 并且阅读了本网站上有关此主题的大部分帖子 但是我仍然感到困惑 我需要一个直接的答案 这是我的情况 我有一个已建立的 Winform 应用程序 但无法使其全部 异步 我现在被迫使用一个全部编写为异步函数的外部库 在我
  • 泛型与接口的实际优势

    在这种情况下 使用泛型与接口的实际优势是什么 void MyMethod IFoo f void MyMethod
  • 避免集合已修改错误

    Issue 我有以下代码 foreach var ItemA in GenericListInstanceB ItemA MethodThatCouldRemoveAnyItemInGenericListInstanceB 显然我得到一个错
  • C++ 非类型参数包扩展

    我正在编写由单一类型参数化的模板函数 并且具有可变数量的相同类型 而不是不同类型 的参数 它应该检查第一个值是否在其余值中 我想这样写 include
  • C++ 私有静态成员变量

    此 C 代码在编译时产生链接器错误 A h class A public static void f private static std vector
  • 如何在 C++ 中对静态缓冲区执行字符串格式化?

    我正在处理一段对性能要求非常高的代码 我需要执行一些格式化的字符串操作 但我试图避免内存分配 甚至是内部库的内存分配 在过去 我会做类似以下的事情 假设是 C 11 constexpr int BUFFER SIZE 200 char bu
  • 使用成员作为实现者来实现接口

    我有实现 IA 的 A 类 现在我需要创建也应该实现 IA 的类 B B 类有 A 类的实例作为成员 有什么方法可以定义A的实例实现B类中的IA吗 interfase IA void method1 void method2 void me
  • 如何防止字符串被截留

    我的理解 可能是错误的 是 在 C 中 当你创建一个字符串时 它会被实习到 实习生池 中 这保留了对字符串的引用 以便多个相同的字符串可以共享操作内存 但是 我正在处理很多很可能是唯一的字符串 一旦完成每个字符串 我需要将它们从操作内存中完
  • 如何获取带有标头的 XML (

    考虑下面的简单代码 它创建一个 XML 文档并显示它 XmlDocument xml new XmlDocument XmlElement root xml CreateElement root xml AppendChild root X
  • 如何用C++解析复杂的字符串?

    我试图弄清楚如何使用 解析这个字符串sstream 和C 其格式为 string int int 我需要能够将包含 IP 地址的字符串的第一部分分配给 std string 以下是该字符串的示例 std string 127 0 0 1 1
  • .Net Core 中的脚手架以及解决方案中的多个项目

    我创建了一个针对 net461 的 Net Core MVC6 应用程序 我使用了一个我非常熟悉的项目结构 其中我将数据 模型和服务类放置在单独的类库项目中 并且 Web 项目引用这些项目 当我尝试搭建控制器时 我收到一条错误 指出我正在搭
  • 无法将方法组“Read”转换为非委托类型“bool”

    我正在尝试使用SqlDataReader检查条目是否存在 如果存在则返回ID 否则返回false 当我尝试编译时 出现错误 无法将方法组 Read 转换为非委托类型 bool 我一直在遵循在 VB 中找到的示例 但似乎翻译可能不正确 pri
  • C# 的空条件委托调用线程安全吗? [复制]

    这个问题在这里已经有答案了 这就是我一直以来编写事件引发者的方式 例如属性更改 public event PropertyChangedEventHandler PropertyChanged private void RaisePrope
  • Qt mouseReleaseEvent() 未触发?

    我有一个显示图片的库 我们称之为 PictureGLWidget 其中 class PictureGLWidget public QGLWidget 所以 PictureGLWidget 扩展了 QGLWidget 在PictureGlWi
  • C 中的 N 依赖注入 - 比链接器定义的数组更好的方法?

    Given a 库模块 在下文中称为Runner 它作为可重复使用的组件 无需重新编译 即静态链接库 中应用程序分区架构的 而不是主分区 请注意 它仅包含main 出于演示目的 Given a set 顺序无关 调用的其他模块 对象Call
  • 实体框架代理创建

    我们可以通过使用来停止在上下文构造函数中创建代理 this Configuration ProxyCreationEnabled false 在 EF 4 1 中创建代理有哪些优点和缺点 代理对于两个功能是必需的 延迟加载 导航属性在第一次
  • 将小数格式化为两位或整数

    对于 10 我想要 10 而不是 10 00 对于 10 11 我想要 10 11 没有代码可以实现吗 即通过指定格式字符串类似于 0 N2 decimal num 10 11M Console WriteLine num ToString
  • C/C++ 通过 Android NDK 在 JNI 中看不到 Java 方法

    我正在尝试从使用 NDK 构建的 C 类文件调用 Java 方法 它不断抛出常见的 未找到非静态方法 错误并导致整个 Android 应用程序崩溃 下面的代码片段 有些东西可能不需要 但我按原样保留它们 因为焦点 问题在于refreshJN

随机推荐

  • STM32HAL库-移植Unity针对微控制器编写测试框架

    概述 本篇文章介绍如何使用STM32HAL库 移植Unity 是一个为C语言构建的单元测试框架 侧重于使用嵌入式工具链 GitHub https github com ThrowTheSwitch Unity 硬件 STM32F103CBT
  • 【Hello Algorithm】堆和堆排序

    本篇博客简介 讲解堆和堆排序相关算法 堆和堆排序 堆 堆的概念 堆的性质 堆的表示形式 堆的增加 删除堆的最大值 堆排序 堆排序思路 时间复杂度为N的建堆方法 已知一个近乎有序的数组 使用最佳排序方法排序 堆 堆的概念 这里注意 这里说的堆
  • python爬虫可视化web展示_基于Python爬虫的职位信息数据分析和可视化系统实现

    1 引言 在这个新时代 人们根据现有的职位信息数据分析系统得到的职位信息越来越碎片化 面对收集到的大量的职位信息数据难以迅速地筛选出对自己最有帮助的职位信息 又或者筛选出信息后不能直观地看到数据的特征 一般规律 变化的趋势或者数据之间潜在联
  • 【CSS】css的background属性用法详解,background常用缩写形式

    background是一个简写属性 可以在一个声明中设置背景颜色 背景位置 背景大小 背景平铺方式 背景图片等样式 语法background 颜色 图片 位置 大小 平铺方式 bg origin 绘制区域 bg attachment bac
  • 区块链开源项目

    bitcoin stars gt 100 forks gt 50 bitcoin OR wallet stars gt 100 forks gt 50 in file extension md 我们使用github的搜索功能 并选择fork
  • jmeter版本不支持的 jdk版本 解决办法

    在win7上安装了apache jmeter 2 11和jdk1 8 0 20 配置成功后 点击jmeter bat报错 截图如下 在网上搜索说是要注释掉set DUMP XX HeapDumpOnOutOfMemoryError 可是注释
  • 为什么你的pycharm打开时很卡,今天来教你解决方案

    相信很多刚开始使用pycharm不太熟练的小伙伴 每天一开机打开pycharm总是卡半天 不知道的还以为是电脑卡了或者啥问题的 莫慌 其实并不是 今天我们就来解决一下这个问题 大致总结了以下这几种方法 1 exclude不必要文件 依次打开
  • Redis使用总结(四、处理延时任务)

    引言 在开发中 往往会遇到一些关于延时任务的需求 例如 生成订单30分钟未支付 则自动取消 生成订单60秒后 给用户发短信 对上述的任务 我们给一个专业的名字来形容 那就是延时任务 那么这里就会产生一个问题 这个延时任务和定时任务的区别究竟
  • vue router进行路由跳转并携带参数(params/query)

    在使用 router push 进行路由跳转到另一个组件时 可以通过 params 或 query 来传递参数 1 使用 params 传参 在路由跳转时传递参数 router push name targetComponent param
  • 元宇宙通证-八、人类科技发展史全景长图

    八 人类科技发展史全景长图 人类科技发展史是人类认识自然 改造自然的历史 也是人类文明史的重要组成部分 科技在人类文明进程中起着至关重要的作用 制造和使用工具以及技术的传承 是人类生存的模式 是被人类社会所实践的 人类自身的进化成功很大程度
  • Java language

    Java Java is a high level general purpose object oriented programming language The main design goals of the language wer
  • qt连接oracle数据库经验总结

    利用qt连接oracle数据库实战经验 之前公司用qt开发的产品中 使用的数据库为mysql和sql server 并未用qt连接过 oracle数据库 因此 只能通过百度查资料的方式解决问题 注意 使用qt连接oracle数据库 即使远程
  • 启元世界内推招聘(对标阿里P6-P7)

    推荐系统架构师 岗位职责 负责游戏推荐系统的需求分析 系统设计 负责应用系统平台的可行技术设计 方案 指导和优化技术选型 负责推荐算法策略线上化 系统化实现在线服务 优化平台线上性能 负责线上平台的稳定性保障 负责推动应用系统的技术升级与研
  • 懂编译真的可以为所欲为

    作者 闲鱼技术 玉缜 背景 整个前端领域在这几年迅速发展 前端框架也在不断变化 各团队选择的解决方案都不太一致 此外像小程序这种跨端场景和以往的研发方式也不太一样 在日常开发中往往会因为投放平台的不一样需要进行重新编码 前段时间我们需要在淘
  • SAE安装第三方插件

    参考官网 http sae sina com cn doc python tools html saecloud 首先要安装sae python dev 1 3 2 tar gz 然后把官网的原话copy上来 在应用目录中执行下面的命令安装
  • 点云密度计算方法matlab,点云中的几何计算及matlab源码

    1 计算法向量 2 计算曲率 曲线的曲率 curvature 就是针对曲线上某个点的切线方向角对弧长的转动率 通过微分来定义 表明曲线偏离直线的程度 数学上表明曲线在某一点的弯曲程度的数值 曲率越大 表示曲线的弯曲程度越大 曲率的倒数就是曲
  • jdbc:mysql:replication_使用Mysql的Replication功能实现数据库同步

    本文档仅在于实验Mysql的Replication功能 没有考虑权限等其他问题 用于实验的服务器和客户机请使用没有安装过Mysql的计算机 如果安装过Mysql请卸载 请按照下面的顺序依次进行 改变顺序可能导致实验失败 1 在下面地址下载免
  • 会议OA项目---我的审批(审批&会议签字)

    目录 一 会议审批 二 会议签字 三 签名裁剪 一 会议审批 我的审批 实体类MeetingAudit package com zking entity import java io Serializable import java uti
  • C语言经典例题-贷款余额

    编程计算第一 第二 第三个月还贷后剩余的贷款金额 include
  • Revit二次开发——选集

    选集 选集 用户选集 过滤的用户选集 选集 选择图元后运行外部命令获取选择的内容 Revit API中定义了单选 多选 框选等方式的用户选集 用户可以十分方便的使用鼠标和键盘完成这三种方式的图元选择 Revit API根据三种用户选集各自的