Inventor中管理Attribute的工具

来源:互联网 发布:硬盘坏了怎么恢复数据 编辑:程序博客网 时间:2024/05/24 05:20

Brian在他的博客Mode the machine中又发布了一个Attribute Helper的免费小工具。我且把Attribute翻译成特性吧。推荐的目的是,这个小工具对一些需要使用到Inventor中的特性的人将会很有很大的帮助,因为你能通过它方便地读取/增加/编辑/删除特性。

写这个小工具的起因是因为Inventor中的Attribute只能通过编程来能访问到,也就是说,如果你需要用到特性,你就要通过写程序来实现,对于使用者来说显然很不方便。有了这个小工具,一切都变得简单了。

从图中可以看到该工具使用的效果。安装很简便。执行.exe后启动Inventor就可以看到附加模块中的Attribute Helper按钮了。

当选择Attribute Helper窗口中的实体节点(比如Face)时,图形中的实体会被选中。该设计用了一个对象列表来存储对象,并且用了文档选择集SelectSet来亮选对象。关于特性集的增减编辑都是很简单的,就是直接调用AttributeSets和AttributeSet的成员函数就能实现。

下面是原文:

Attribute Utility

Working with attributes can sometimes be a bit frustrating because the only access you have to attributes is through the API.  You can’t quickly create, edit, or view an attribute without writing a program to do it.  Because of this I became a bit frustrated when working on my first program that made extensive use of attributes.  For the program to function correctly the attributes it was using all had to be correct and it was difficult to debug problems to determine if the problem was my program or the attributes it was trying to access.

For my own sanity I wrote a little utility that would let me view all of the attributes in a document.  That helped a lot but I never felt it was finished because it only allowed me to view existing attributes and I still couldn’t easily create or edit an existing attribute without writing code.  As part of the series of blog posts I’ve I’m writing about attributes, I’ve completely re-written the utility so that it provides full creation, edit, and viewing of attributes.  This new version of the utility is an add-in.  To use it just download and install the add-in and look at the readme that’s installed for instructions on how to use it.  When installing you have the option of also installing the source code, if you’re interested in the internals of how it works.  It was written using the Visual Basic language in Visual Studio 2008.

Let me know if you have suggestions or find any problems.

原创粉丝点击