2012版Workset的新功能

 

关于之前提到 REVIT 2012 版本
可以针对工作集找出相关资料
但我试过使用 "RevitLookup" 并未发现相关的资料
不知道这版本是否仍未对此部份加入引用呢?
另外HELP中,虽然可以查到 "Workset Class" 类别资料
但是否有案例可以参考呢?

 

答:

Revit2012版的REvitlookup工具没有使用的workset这个属性。在2012版提供了丰富的workset 操作API。在SDK中还没有示例代码,这个用法比较直接,应该容易理解。下面是帮助的引用。

Several new classes were added to provide access to worksharing information in the document:

  • Workset - Represents a workset in the document. Worksets are a way to divide a set of elements in the Revit document into subsets for worksharing.
  • WorksetId - Identifies a workset within a single document.
  • WorksetKind - An enumerated type that indicates one of the standard kinds of workset (as available in the UI).
  • WorksetTable - A table containing references to all the worksets contained in a document.
  • WorksetVisibility - An enumerated type that indicates the visibility settings of a workset in a particular view.
  • WorksetDefaultVisibilitySettings - An object that manages default visibility of worksets in a document.
  • FilteredWorksetCollector - This class is used to search, filter and iterate through a set of worksets. Developers can assign a condition to filter the worksets that are returned. If no condition is applied, it attempts to access all the worksets in the document.
  • FilteredWorksetIdIterator - An iterator to a set of workset ids filtered by the settings of a FilteredWorksetCollector.
  • FilteredWorksetIterator - An iterator to a set of worksets filtered by the settings of a FilteredWorksetCollector.
  • WorksetFilter - A base class for a type of filter that accepts or rejects worksets based upon criteria.
  • WorksetKindFilter - A filter used to match worksets of the given WorksetKind.
  • ElementWorksetFilter - A filter used to match elements which reside in a given workset (use this filter with FilteredElementCollector).
  • WorksharingUtils – access to information about a work-shared document.
  • WorksharingTooltipInfo – basic read-only information about a work-shared document, such as owner, creator, etc.

Some related additions were made to existing classes:

  • Document.GetWorksetTable() - Gets the WorksetTable of this document. There is one WorksetTable for each document.
  • Document.GetWorksetId(ElementId id) - Gets the id of the Workset which owns the element.
  • Element.WorksetId - Gets the id of the workset which owns the element.
  • View.GetWorksetVisibility(WorksetId worksetId) - Returns the visibility settings of a workset for this particular view.
  • View.SetWorksetVisibility(WorksetId worksetId, WorksetVisibility visible) - Sets visibility for a workset in this view. This setting overrules implicit visibility of the workset for this particular view.
  • View.IsWorksetVisible(WorksetId worksetId) - Indicates whether the workset is visible in this view.

In addition, there is API support for the new 2012 worksharing visualization functionality:

  • View.SetWorksharingDisplayMode and View.GetWorksharingDisplayMode allow the API to control which worksharing display mode is enabled in the view.
  • WorksharingDisplaySettings allows getting and setting the specific graphic overrides that will be applied in the various worksharing display modes.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Java Development Kit (JDK) is a software development environment used for developing Java applications. It includes the Java Runtime Environment (JRE) and an implementation of the Java Virtual Machine (JVM). Over the years, various versions of the JDK have been released, each with its own set of features and improvements. Here are some of the ways in which different versions of the JDK have optimized the `String` class: 1. JDK 1.0: The initial release of the JDK included the `String` class, which represented a sequence of characters. 2. JDK 1.1: The `StringBuffer` class was introduced, which allowed `String` objects to be modified without creating a new object. This was more efficient than the previous method of creating a new `String` object for each modification. 3. JDK 1.4: The `StringBuilder` class was introduced, which was similar to `StringBuffer` but was not synchronized. This made it more suitable for use in single-threaded environments, as it was slightly faster than `StringBuffer`. 4. JDK 5.0: The `String` class was enhanced to include support for regular expressions, which allowed for more powerful string manipulation. 5. JDK 7: The `String` class was further enhanced to include support for working with Unicode code points and code units. 6. JDK 8: The `String` class was enhanced to include several new methods for working with strings, including `join`, `repeat`, and `lines`. Overall, the JDK has continued to improve the performance and functionality of the `String` class in successive releases, making it easier and more efficient to work with strings in Java. ### 回答2: Java开发工具包(JDK)是Java语言开发的核心组件之一,它的历代本都对String类进行了优化。 首先是JDK 1.0和1.1本中的String类,它使用的是传统的char类型数组来存储字符串。这种设计方式导致了一些性能问题,比如字符串拼接和字符串比较的效率较低。 然后,JDK 1.2本引入了String类的重要改进,即引入了字符串常量池(String Pool)的概念。字符串常量池可以降低内存开销,提高运行效率。它通过存储字符串的地址引用来避免重复创建相同的字符串对象,节省了内存空间。 接下来,JDK 1.4本引入了StringBuffer类和StringBuilder类。这两个类实现了可变字符串的功能,可以高效地进行字符串拼接操作。StringBuffer类是线程安全的,适用于多线程环境下的字符串操作,而StringBuilder类是非线程安全的,适用于单线程环境下的字符串操作。它们的引入极大地提升了字符串拼接的效率。 此外,JDK 6本引入了String类的改进,即将字符串常量池从方法区移到了堆中。这样一来,字符串常量池的大小限制就不再受到方法区大小的限制,提高了字符串处理的灵活性。 最后,在JDK 7和8本中,引入了基于UTF-16编码的Compact Strings优化。这个优化将字符串按照ASCII字符和非ASCII字符进行存储,大大减少了内存的使用。 综上所述,JDK历代本对String的优化主要包括:引入字符串常量池、引入可变字符串类、改进字符串常量池的储存位置以及基于UTF-16编码的字符串存储优化。这些改进都为Java程序员提供了更高效、更灵活的字符串处理能力。 ### 回答3: JDK(Java Development Kit)是Java开发工具集,它提供了Java编译器、调试器、运行环境等工具。JDK历代本对String的优化主要包括以下几方面。 1. Java 1.0本:初始本的JDK中,String是通过字符数组来表示的,每当对String进行字符串连接(使用+操作符)时,都需要创建一个的字符数组,对性能有一定的影响。 2. Java 1.2本(也称为Java 2):引入了字符串常量池的概念。字符串常量池是JVM中的一个特殊存储区域,在常量池中保存了一组唯一的字符串对象。当使用字符串字面量创建字符串时,会先在常量池中查找是否已存在相同内容的字符串,若存在,则直接返回引用,而不需要再创建的字符串对象。这样可以提高内存的利用率和程序的执行效率。 3. Java 1.5本(也称为Java 5):引入了StringBuilder和StringBuffer类。在之前的本中,每次字符串连接操作都会创建一个的String对象,对于频繁的字符串连接操作会造成大量的内存开销。而StringBuilder和StringBuffer都是可变字符串,它们提供了一系列的字符串操作方法,例如append()和insert(),可以避免每次连接字符串时都创建的对象,提高了字符串连接的效率。 4. Java 1.7本(也称为Java 7):引入了String的intern()方法。该方法会将字符串添加到常量池中,并返回对应的引用。当通过intern()方法获取到字符串时,可以直接使用常量池中的引用,避免每次字符串比较时都使用equals()方法。 5. Java 1.8本(也称为Java 8):引入了的字符串拼接方式,即使用+操作符连接常量字符串时,编译器会自动优化为使用StringJoiner或StringBuilder拼接字符串,提高了字符串连接的效率。 综上所述,JDK历代本对String的优化包括字符串常量池、StringBuilder和StringBuffer的引入、字符串intern()方法以及的字符串拼接方式等,这些优化措施在提高内存利用率、减少内存开销以及提升字符串连接效率等方面起到了积极的作用。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值