理解装配中的文件引用-1

【SpringBoot】Spring手动装配和SpringBoot自动装配 文章目录1. Warm up1.1 setter注入1.2 构造器注入1.3 属性注入2. Warm up again2.1 基于XML的配置2.2 基于JavaConfig类的配置3. BeanDefinition4. BeanDefinition结构4.1 beanClass4.2 autowireMode4.3 constructorArgumentValues5. 装配对象6. My自动装配6.1 自动装配之再思考6.2 一个例子6.3 @Import注解6.3.1 @Import(A.class) 阅读详情

原文地址:http://modthemachine.typepad.com/my_weblog/2008/11/understanding-file-references.html

我们知道, Inventor的装配需要插入零件,子装配, 零件中心零件等. 而底层的机制只是使用了源文件的一部分信息, 而不是整个文件都插入. 在需要的时候.例如显示,则从原文件获取数据,创建代理实体,从而在屏幕上看到结果. 这种机制, 从API的角度, 叫做"引用".

本文更详细的介绍如何理解"引用".

Overview

To start let's look at a very simple case of creating an assembly.  When you first create the assembly (Assembly.iam in this example) it is empty and doesn't have any references to other files.    When you place a part into the assembly there are two things that Inventor creates.  It creates the occurrence that you see in the graphics window and as a node in the browser, and it also creates a reference to the part file.  The file reference isn't something you see in the user interface but is an internal action that takes place.

 一个新装配一开始 没有任何内容. 插入一个零件后, Inventor做了两件事情. 首先创建了零件实例,从而看到了零件表达的图形,浏览窗口也能看到一个新节点.另外Inventor创建了对零件的引用. 这种引用是从用户界面看不到的,而是作为内部使用的机制.

To make sense of the file reference concept, I visualize the references as a table in each Inventor document.  The table is a list of all of the files that file references.  The table doesn't know why the reference exists (in this example because of an occurrence being placed), but just that there is a reference to a certain file.  Below is a picture that illustrates this.  It's the assembly with a single instance of Part1.ipt.  We see the part in the graphics window and in the browser.  It also shows a representation of the internal table that contains a list of the referenced files, which in this case has a single file in the list.

打个比方, 在每个Inventor文档虚构一个引用表,列出了所有该装配引用的文件. 表格本身并不知为何该引用存在,但只是知道有个引用。下面是一张截图:一个含有part1.ipt的装配。可以看到左面的浏览窗口列出了该零件。在右面的表格也显示出当前装配有一个引用。

FileReferences1

Now I've added a second part to the assembly, Part2.ipt, with the result shown below.  The result shouldn't be surprising; a new occurrence in the graphics window and browser and another file in the reference table.

当我们插入第二个零件,part2.ipt,则结果是浏览器窗口和表格都反应出增加的这个引用。

FileReferences2

Now I've added two more instances of Part1.ipt.  You see the additional occurrences in the graphics window and the browser but the reference table hasn't changed.  That's because there was already a reference to Part1.ipt.  There's never more than one reference for a particular file.

接着再插入一次part1.ipt,这时浏览器增加了一个节点,而表格却没有任何新内容。这是因为part1.ipt已经被引用,无论插入多少次,都只算作一次引用。

FileReferences3

When this assembly is opened, Inventor reads the referenced file table, finds the actual file on disk, and opens it.  Inventor can then use the contents of that file for whatever the reference is used for; assembly occurrences, drawing views, derived parts, etc.

因此每当我们打开一个装配,Inventor将读取引用表,找到对应的文件,打开之。接着Inventor读取其中的内容(例如几何信息)在装配中显示出来。

File References and Where Used

One important thing to highlight here  is that the files being referenced, (Part1.ipt and Part2.ipt in this example) don't know they're referenced by another file.  Referencing a file doesn't change it in any way.  This is important because a part can be used in any number of assemblies or drawings.  Also a file might be read-only because of being an approved part and not available for edit or because the file exists on a read-only media. 

A couple of the recent questions on the newsgroup had to do with determining where a file is used.  Given Part1.ipt they want to know where it is used.  It's a reasonable question, but as you can see from the discussion above, it's not a question that Part1.ipt can answer because it doesn't know.  Design Assistant supports where usedfunctionality but it does this within the limitations we've just discussed.  Design Assistant looks through all of the files in a specified set of directories and reads the referenced file list within each file to see if that file references the file you want the where used information for.  This has the limitation that it's only reporting for the files in the searched directories.  PDM applications will typically save file reference information in a database when files are checked in and use this data to determine where used information.

这里需要注意的是,part1.ipt和part2.ipt并不知道它们被哪个装配引用了。有些需求就是想知道哪些装配引用了某零件。 Design Assistant 可在所有特定的文件夹中去寻找哪些文件引用了某零件。而局限就是只是这些特定文件夹。

Projects

Another topic that's important to understand relative to file references is projects.  In the previous example, I explained that when the assembly is opened Inventor reads the referenced file list and then finds and opens the referenced files.  To find the files Inventor uses the project information.  The easy way to visualize a project is that it defines a list of directories to search.  When Inventor reads Part1.ipt from the referenced file list it looks through the directories specified by the project to find Part1.ipt.  Because of the flexibility of defining where files are you can easily move files around and as long as the project points to the new location Inventor will find and open the file.  The file reference stored is basically just the file name, not the path because the path is dynamically defined by the current project.

另外需要理解的是,相对于项目的引用。前面提到,装配打开后,将找寻引用的文件。最方便的就是项目所包含的文件夹。因此Inventor首先尝试从这些文件夹去寻找。这样,当做复制时,可以直接拷贝整个项目。

Changing References

A common task is to change a file reference.  Here's a simple example to illustrate.  It starts with the assembly from the previous example where it references two parts; Part1.ipt and Part2.ipt.

用户还可能修改引用文件。例如前面插入了part1和part2的装配。

FileReferences4

I want to make a revision to Part1.ipt so I make a copy to Part1_Rev1.ipt and make the required changes.  The picture below illustrates the current situation.  The assembly is unchanged but I have a new file, Part1_Rev1.ipt, sitting on my disk.

我想修改part1,则复制了一份Part1_Rev1.ipt ,做修改,如下面最右面的图示。装配当然没有变化。

FileReferences5 

I want my assembly to use the Part1_Rev1.ipt instead of Part1.ipt, as shown below.  There are a few ways to accomplish this but the result is that the reference in the assembly is changed to another file.  The occurrences that use that reference automatically reflect the new file.

当引用从 Part1.ipt变化到 Part1_Rev1.ipt ,则装配会发生更新,如下图。

FileReferences6

There are a few ways to get the result shown above.  Within Inventor you do it using the Replace Component or Replace All command, which indirectly will edit the referenced file list.  You can also accomplish this using Design Assistant.  Finally Inventor's API lets you change the file references.  In fact, from the API you have direct access to the reference file table, which is also what Design Assistant uses internally.

API提供了替换的相关方法, 例如ComponentOccurrence.Replace。


Limitation

There is one limitation to be aware when attempting to change a file reference.  The general rule is that the new file must be a descendant of the original file.  In the example above, Part1_Rev1.ipt is a descendant of Part1.ipt because it was created by copying Part.ipt and then subsequently edited.  Because of this when the reference is changed, assembly constraints are able to compute correctly and the assembly behaves as expected.

需要注意,被替换文件和替换文件需要时同源的。上面提到的Part1_Rev1.ipt 和Part1.ipt同源,因为前者是从后者复制的。只有同源的替换,原有的约束等信息才能计算正确。

 

深入理解Spring框架中的集合自动装配 Spring框架是由Rod Johnson在其著作《Expert One-to-One J2EE Design and Development》中首次提出的,目的是简化企业级应用开发。自2003年发布以来,Spring凭借其轻量级、依赖注入和面向切面编程(AOP)等特性,已成为Java企业应用开发的事实标准。Spring的模块化设计允许开发者按需选择组件,而依赖注入(DI)机制则是Spring的核心特性之一。 阅读详情

相关推荐

SolidWorks手动阀装配教程与源文件解析

SolidWorks是一款功能强大的三维计算机辅助设计(CAD)和计算机辅助工程(CAE)软件,广泛应用于产品设计、工程分析和制造领域。它提供了从零件设计、装配到绘图的全面解决方案,是机械设计领域的主流工具之一。

weixin_29138345的博客 1211

理解装配中的文件引用-2

本文接着上一篇 【理解装配中的文件引用-1】http://blog.youkuaiyun.com/autodeskinventorapi/article/details/8505452。  原文链接:http://modthemachine.typepad.com/my_weblog/2008/11/file-references-part-2.html I received a question

Gear Up Cloud 857

NLM去噪算法:原理、优化与医学图像处理实战

本文深入解析NLM去噪算法的核心原理及其在医学图像处理中的优化应用。通过全局自相似性计算,NLM算法有效抑制噪声并保留细节,特别适用于超声图像斑点噪声处理。文章还介绍了积分图像和傅里叶变换等优化技巧,显著提升计算效率,并分享医学影像项目中的实用调参经验。

weixin_29051149的博客 346

Spring中的@Autowired自动装配

一:什么是自动装配 自动装配:就是 spring 会在容器中自动的查找,并自动的给 bean 装配及其关联的属性 涉及到自动装配Bean的依赖关系时,Spring 有多种处理方式。因此,Spring 提供了 4 种自动装配策略 public interface AutowireCapableBeanFactory extends BeanFactory { // 无需自动装配 int AUTOWIRE_NO = 0; // 按名称自动装配 bean 属性 int AUTOWIRE_BY_NAM

桐花思雨 6234

【Isaac Sim】无头服务器远程桌面连接实战:Turbovnc配置与常见问题解决

本文详细介绍了在无头GPU服务器上通过Turbovnc远程桌面连接并运行NVIDIA Isaac Sim的实战教程。针对无图形界面服务器运行仿真软件的核心痛点,文章提供了从Turbovnc安装配置、SSH隧道建立,到以普通用户身份启动服务、解决GLXBadFBConfig等常见图形错误的完整方案,帮助开发者在云端高效部署机器人仿真环境。

weixin_29254673的博客 773

泛微 OA - 根据流程 requestid 获取流程中的附件

在泛微 OA 流程中,附件是通过加密上传的,如果在第三方系统想要调用 OA 系统获取 OA 附件,暂时没有很好的方法实现。但是可以在本地进行调用,得到附件信息,拿到这些信息后,可以用过 url 地址在本地下载。

小松鼠的博客 5829

面试官:谈谈你对 Spring Boot 自动装配机制的理解

自动装配作为 Spring Boot 最核心的特性,它的起源可以追溯到 Spring Boot 的诞生背景,同时它也是面试常问的一个考点,这篇文章将带着大家对其全面掌握。

大鹏的博客 4964

Camunda流程引擎 Modeler (二)

Camunda Modeler是Camunda官方提供的建模器: 独立安装的建模器([windows、linux、mac]

1311

从Bean的装配理解Spring框架

Bean装配 BeanFactory接口:Spring的IOC容器核心接口,它的职责包括,实例化,有很多的实现类;如`ApplicationContext`接口:用于访问应用程序组件的Bean工厂方法,以通用方式加载文件资源的能力等Spring的上下文,我简单理解就是spring的当前运行的环境,也可以理解是spring可以利用的资源。ApplicationContext有两个主要的实现类:ClassPathXmlApplic

分享技术,享受生活 4778

GEE案例教程:融合Sentinel-1 SAR数据、Sentinel-2光学影像和WorldPop人口数据,构建完整的洪水监测与影响评估工作流

本文介绍了一个专为巴基斯坦哈扎拉分区设计的洪水监测系统,该系统整合了Sentinel-1 SAR数据、Sentinel-2光学影像和WorldPop人口数据等多源遥感数据。系统通过VV极化SAR数据的水体提取算法(阈值-13dB)实现洪水范围监测,结合10米分辨率的光学影像进行可视化验证,并利用100米分辨率人口数据评估受灾人口。系统提供完整的技术实现,包括研究区加载、遥感数据处理、日期选择界面和洪水变化检测等功能模块,为灾害应急响应提供科学依据。

此星光明博客 191

智能车图像处理16-进阶篇8--右环岛状态机与补线

这篇文章主要讲述智能车竞赛中如何判断右环岛并且进行状态补线。

taiyuezyh的博客 1万+

解密Spring Boot:深入理解条件装配与条件注解

这篇文章将深入探讨Spring Boot中条件装配与条件注解的重要性和应用。它将解密这些概念,帮助读者更好地理解如何根据特定条件来决定是否创建bean或配置应用程序的行为。通过详细介绍条件装配的工作原理和条件注解的使用方法,读者将能够更好地利用Spring Boot框架的强大功能来构建灵活且高度可配置的应用程序。这篇文章将为读者提供清晰的指导,帮助他们更好地利用条件装配和条件注解来优化他们的Spring Boot应用程序。

忆~遂愿的博客 5133

QtQuick QML教程(2):qml语法介绍

​ qml一个普通的文本文件,后缀是.qml, 一个qml文件主要由两部分组成:(1) import语句 :这个就像C++中的头文件, 使用 import 导入qml需要的相关模块,可以查询Qt文档进行导入,注意每个版本的Qt模块声明可能都不同,相比于QWidget项目,QtQuick的变动是很大的;(2) QML对象树 :根对象是Window, 然后可以在Window中添加各种控件,例如按钮,文本,菜单等。

琅嬛福地 551

Spring自动装配原理理解

Spring本质上就是一个管理程序应用的容器,而spring的一个核心功能就是自动装配,也就是在程序启动时就自动将应用所需的所有bean自动扫描、配置和装入到容器中去,方便程序的使用。 什么是SpringBoot自动装配? SpringBoot 定义了一套接口规范,这套规范规定:SpringBoot 应用在启动时会扫描外部引用 jar 包中的META-INF/spring.factories文件,将文件中默认配置信息加载到 Spring 容器(此处涉及到 JVM 类加载机制与 Spring 的容器知识.

Eskiii的博客 3968

Windows 下 Hermes Agent(爱马仕)安装全记录:从零到一的保姆级图文教程

本文主要介绍了Windows 下 Hermes Agent(爱马仕) 安装全记录:从零到一的保姆级图文教程,希望能对学习使用 Hermes Agent 的同学们有所帮助。 文章目录 1. 背景 2. 实战教程 2.1 步骤一 安装WSL环境 2.2 步骤二 安装Python环境 2.3 步骤三 安装Hermes Agent 2.4 步骤四 修正 API Key 错误 2.5 步骤五 配置多个模型 2.6 步骤六 启动Hermes Agent 3. 常见问题及解决方案 4. 总结

weixin_43178406的博客 14万+

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

Spring Boot的自动装配原理

自动装配是springboot的核心,一般提到自动装配就会和springboot联系在一起。实际上SpringFramework早就实现了这个功能。SpringBoot只是在其基础上,通过SPI的方式,做了进一步优化。SpringBoot定义了一套接口规范,这套规范规定SpringBoot在启动时会扫描外部引用jar包中的文件,将文件中配置的类型信息加载到Spring容器(此处涉及到JVM类加载机制与Spring的容器知识),并执行类中定义的各种操作。...

YING—country的博客 3万+

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

第六节 自动装配源码理解

自动装配是 Spring 框架用来减少配置的显式需求而引入的一个特性,该特性通过@Autowired或者@Resource注解实现依赖对象的自动注入。而 Spring Boot 在此基础上进一步发展,提出了更高级的自动配置(Auto-configuration)概念。

uzong 1512

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

Spring自动装配机制详解

自动装配就是会通过Spring的上下文为你找出相应依赖项的类,通俗的说就是Spring会在上下文中自动查找,并自动给Bean装配与其相关的属性!

猿小许的博客 1万+

springboot自动装配原理

springboot自动装配原理

qq_24078621的博客 1万+

Spring 自动装配

简单理解 自动装配,就是将一个Bean注入到其他Bean的Property中。Spring框架式默认不支持自动装配的,要想使用自动装配需要修改spring配置文件中<bean>标签的autowire属性 代码样例 package com.spring.auto.autowire; public class Cat { public void sayCat(){ ...

Hern(宋兆恒) 1万+

Springboot自动装配的原理

springboot在日常开发中减少了我们许多工作量减少了很多XML配置,这都得益于springboot自动装配的特性。 那么springboot是如何实现自动装配的呢 ? 首先我们浅显得介绍一些 springboot的一些主要注解: @Configuration 用于声明定义bean 这也是springboot 中的主要注解 其实就是平常Spring配置文件中我们写的bean @EnableAutoConfiguration 用来开启springboot自动配置的注解 ,这个也是自动装...

代码搬运工 2万+

springBoot手动装配,自动装配 实例

将今天岗培关于springBoot容器装配的知识整理一下,清理一下知识盲区,通过自己建立的小demo加深印象。 1.建立普通的web项目: 使用spirngBoot后,分分钟可以搭建一个web项目。如下: 搭建好后,通过访问地址可以进行验证: 2.目录解构: 这里单独强调一下目录解构的原因在于: SpringBoot默认会扫描当前项目启动类同级,及其下级的类...

automannn 2498

Bean的装配方式

什么是Bean的装配? Bean的装配可以理解为依赖关系注入,Bean的装配方式即Bean依赖注入的方式。Spring容器支持多种形式的Bean装配方式,如基于XML的装配 , 基于注解(Annotation)的装配方式 以及 自动装配方式 ,其中最为常用的是基于注解的装配方式 。 基于XML的装配方式 基于XML的装配方式有两种,一种是设值注入 另一种是构造注入 ,他们分别有不同的使用条件。 设...

weixin_43499644的博客 3206

深入理解SpringBoot自动装配过程中的Bean初始化流程笔记

也是Spring中的BeanFactory接口的一个非常全面的实现类,他存在的目的就是对外提供Bean的实例化和属性注入的功能,主要专注的是Bean 的创建与生命周期管理。同时他还是刚刚提到的第二个DefaultListableBeanFactory的父类对于者几个类的依赖关系,我们可以这么理解继承 AbstractBeanFactory:复用了 “获取 Bean、检查Bean缓存” 等基础逻辑;实现AACBF接口:提供了 “自动装配(如@Autowired。

hjxbgxujsbvgx548的博客 1299

Springboot 3.2.1 自动装配原理

加载读取工作:会对找出的所有配置类,配置类中的Method Bean, 配置类的importedResources以及配置类的ImportBeanDefinitionRegistrars进行读取,放置到。下查找到所有的config class,也会对查找的config class进行同样的遍历查找,找出所有的配置类。的思路,简化开发难度(通过IOC,AOP,以及注解的方式),让开发人员更专注于对业务的实现。基于Spring强大的生态,通过。中,等待随后的bean初始化,实例化过程,完成自动配置启动。

Machiel_One的博客 1155
上一篇: 批量控制工作特征,草图的可见性
下一篇: 2012 AU 中国大师汇的演讲内容已经可以下载 (免费)
autodeskinventorapi
博客等级 码龄14年 313粉丝 164原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值