根据WTPartMaster获取其对应的所有WTPart的方法

根据WTPartMaster获取其对应的所有WTPart的方法:

LatestConfigSpec latestconfigspec = new LatestConfigSpec();
QueryResult queryresult = ConfigHelper.service.filteredIterationsOf(partMaster, latestconfigspec);

获取小版本的方法:
VersionControlHelper.getIterationIdentifier((Iterated)wtpart).getValue();

System.out.println(wtpart.getName());
System.out.println(wtpart.getNumber());
System.out.println(wtpart.getVersionDisplayIdentifier().getLocalizedMessage(Locale.CHINA));
System.out.println(wtpart.getVersionDisplayIdentity().getLocalizedMessage(Locale.CHINA));
System.out.println(wtpart.getVersionDisplayType().getLocalizedMessage(Locale.CHINA));
System.out.println(wtpart.getVersionIdentifier().getValue());
System.out.println(wtpart.getVersionInfo().getIdentifier().getValue());
System.out.println(wtpart.getView().getName());
System.out.println(wtpart.getViewName());

显示的结果为:

GOLF_CART
GC000001
A.A (Manufactur
修订 (视图) A.A
修订 (视图)
A.A
A.A
Manufacturing
Manufacturing


关于WTPart、EPMDocument和CAD图纸的问题

我已知一个WTPart对象,怎么才能得到该对象的CAD图纸呢
有人说是要先得到EPMDocument,那么我怎么从EPMDocument里面拿到这张图纸呢
供参考:
contentholder = ContentHelper.service.getContents(contentholder);

Enumeration enum = ContentHelper.getContentListAll(contentholder).elements();

while (enum != null && enum.hasMoreElements())

{
ContentItem item = (ContentItem) enum.nextElement();

if (item instanceof ApplicationData)

{
ApplicationData appData = (ApplicationData) item;
ContentServerHelper.service.writeContentStream(appData, pathName + File.separator + appData.getFileName());

}

}

请查阅相关API。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在 Eclipse 中使用 Windchill 远程方法服务器进行测试,可以按照以下步骤进行: 1. 在 Eclipse 中创建一个 Java 项目。 2. 导入 Windchill 客户端 jar 包,并将其添加到项目的构建路径中。 3. 创建一个 Java 类,用于测试 Windchill 方法服务器。在该类中,创建一个 Windchill 客户端对象,并使用其方法来调用 Windchill 服务器上的方法。示例代码如下: ```java import wt.util.WTProperties; import wt.fc.PersistenceHelper; import wt.method.RemoteMethodServer; import wt.part.WTPart; import wt.part.WTPartMaster; import wt.session.SessionHelper; import wt.session.SessionManager; import wt.util.WTException; public class WindchillMethodServerTest { public static void main(String[] args) throws Exception { // 设置 Windchill 属性 WTProperties wtProps = WTProperties.getLocalProperties(); wtProps.setProperty("wt.home", "C:/PTC/Windchill_11.0"); // 登录 Windchill SessionHelper.manager.setAdministrator(); SessionManager.setLocale(SessionHelper.getLocale()); // 创建 Windchill 客户端 RemoteMethodServer server = RemoteMethodServer.getDefault(); // 调用 Windchill 方法 WTPartMaster partMaster = (WTPartMaster) PersistenceHelper.manager.load(new WTPartMaster()); WTPart part = partMaster.createIteration(null); server.invoke("testWindchillMethod", WindchillMethodServerTest.class.getName(), null, new Class[]{WTPart.class}, new Object[]{part}); } public static void testWindchillMethod(WTPart part) throws WTException { // 在此处编写测试代码,调用 Windchill 方法进行测试 } } ``` 4. 在 testWindchillMethod 方法中编写测试代码,调用 Windchill 方法进行测试。 注意:在进行测试之前,需要确保 Windchill 服务器已经启动,并且 Windchill 方法服务器已经启用。同时,需要将 Windchill 客户端 jar 包添加到项目的构建路径中,以便 Eclipse 能够识别 Windchill 类和方法

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值