其他 Windchill 功能 > 制造过程管理 > 自定义产品结构浏览器 (PSE) > 自定义 PSE 结构查询
  
自定义 PSE 结构查询
目标
您想要自定义PSE“新建查询”对话框,以包括 WTPart 的子类型,并允许创建引用子类型可重用属性的查询。
背景
通过“视图”->“查询”->“新建查询”菜单条目启动的对话框可供用户构造查询,此查询将在结构中查找与指定条件相匹配的对象。出厂设置配置允许查询 WTPart 的特定属性。
客户将用自己的属性创建自己的 WTPart 子类型。要在查询中使用这些项,即需要自定义 PSE XML 文件。
范围/适用性/假设
由于这些更改是针对 PSE XML 文件所做的,因此,它们适用于所有 PSE 用户。
预期结果
您可能想要在可搜索类型中包括可变 WTPart "myPart",并允许查询属性 "myCost" 和 "myDescription"。由于“成品”、“类属”和“位号”与此类型不相关,因此系统会将它们从“特性”下拉列表中移除。
解决方法
<Windchill>/codebase/config/logicrepository/xml/explorer/structure
explorer/ExplorerSearchableTypes.xml
中添加相应的元素组:
元素组将针对 "myPart" 类型定义 AttributeGroup (id="ptc.wnc.exp.QuerySearchableAttrs") 的 CellDefinition (添加项和移除项)。
必备知识
要实现此目标,您需要了解以下内容:
XML 文件自定义的管理
解决方案元素
元素
类型
说明
ExplorerSearcha bleTypes.xml
XML 文件
保留将会显示在“新建查询”对话框中的类型和属性的定义。
位于:
<Windchill>/codebase/config/logicrepositor
y/xml/structureexplore
LogicContext
XML 元素
指定待应用定义的应用程序和数据类型
AttributeGroup
XML 元素
PSE 会找出 id 为 ptc.wnc.exp.QuerySearchableAttres 的所有属性组,并使用类型继承来查找所有将要显示的属性 (CellDefinition)。
CellDefinition
XML 元素
将会显示的特性的 id。
Placement remove="true"
XML 元素
Remove=true 用于阻止特性因继承而显示。
步骤
编辑文件 ExplorerSearchableTypes.xml,在最后一行 </LogicRepository> 之前插入以下各行:
<!-- New Query definition for subtype myPart -->
<ExplorerElementGroup>
<LogicContext application="ptc.wnc.StructureExplorer"
dataType="com.aprilia.www.myPart"/>
<AttributeGroup id="ptc.wnc.exp.QuerySearchableAttrs" displayMode="view">
<!-- Remove the following that would otherwise be inherited from WTPart
Definition -->
<CellDefinition id="endItem">
<Placement remove="true"/>
</CellDefinition>
<CellDefinition id="genericType”>
<Placement remove="true"/>
</CellDefinition>
<CellDefinition id="referenceDesignator">
<Placement remove="true"/>
</CellDefinition>
<!-- Add the specific attributes of myPart -->
<CellDefinition id="myCost">
<AttributeDefinition attributeId="com.aprilia.www.myCost"/>
</CellDefinition>
<CellDefinition id="myDescription">
<AttributeDefinition attributeId="com.aprilia.www.myDescription"/>
</CellDefinition>
</AttributeGroup>
</ExplorerElementGroup>
重新启动方法服务器后,将会导致 "myPart" 显示在“类型”下拉列表中,同时移除“特性”条目“成品”、“类属”和“位号”,并添加 "myCost" 和 "myDescription",如“预期结果”部分中所示。
或者,如果要通过 XML 自定义对 PSE UI 的其他方面进行更改,可以将这些附加的行添加至保留所有 "myPart" 自定义的 XML 文件。
自定义点
从 ExplorerSearchableTypes.xml 移除 WTPart 定义是有效操作,因此部件不会显示在“类型”下拉列表中。但是,子类型定义不会继承任何属性定义,因此必须添加属性定义。