|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
[& G- n( B& O6 p+ w$ N' f- y/ b) F
Teamcenter SOA开发源码: 打印对象信息
2 O0 ^8 Z- V6 W. b4 V) j- L6 V
" x1 m5 y6 d% I$ F x" o
& O6 {0 J* C1 p C4 Y. K, d! p[mw_shl_code=java,true]import com.teamcenter.clientx.AppXSession;/ g, L# I1 s# U' i& L& A, r1 j- {
import com.teamcenter.services.strong.core.DataManagementService;
$ n9 I* x* _7 N- ^. F1 x2 Q" ^import com.teamcenter.soa.client.model.ServiceData;
9 W6 @6 w6 o; V8 P7 V9 oimport com.teamcenter.soa.client.model.ModelObject;
" ?. f/ ~6 o, i, t1 Aimport com.teamcenter.soa.exceptions.NotLoadedException;% c' G; x+ [/ u$ ~
( R9 w! U- `+ V% q$ L4 F& W* p7 q& ?) G1 o; m
public void printObject_strings(ModelObject[] objects)) ?" R$ _' }7 j: E7 l* ]; C4 D7 u1 L
{* J0 J2 W+ t5 |5 n. R, z4 D& n
DataManagementService dmService = DataManagementService.getService(AppXSession.geTConnection());
: B, ^( P! f M9 ^/ r) s if (objects.length == 0) return;+ c5 J0 X" v3 Y
String[] attributes = {"object_string"};
! e6 e, Q( ^ d# `3 h dmService.getProperties(objects, attributes);' w- E3 c3 W8 I0 t
for (int i = 0; i < objects.length; i++)6 f# H5 I* {% D% Z8 e; l
{
0 S2 ~, ^! t5 P. y String type = objects.getTypeObject().getName();- |/ r% B' O1 p. `% q( l( }
String objectString = "";# Q; \5 S5 s! n: `0 ^5 @3 p# O
if (objects.getTypeObject().isInstanceOf("POM_object"))) G/ N" I1 d1 T9 J) P3 i& d6 J
{1 C" U& f# w( V$ t8 u
try
) Y5 L+ V2 f* p }% i$ x. y {7 ^. Q; f1 d. X. w; {( }& s, S
objectString = wo.getPropertyObject("object_string").getStringValue();
/ G' z# r5 n) P }, l# e; R8 O! P. i4 R8 v
catch (NotLoadedException e) {} // just ignore& x8 m2 A9 C5 N8 ]5 t1 k
}% j8 r/ u$ j( Z ]. t; x
System.out.println(" " + objectString + "(" + type + ")" );( b, f3 J' D, n' h
}0 S% Z# e6 c+ V. ^, z! q" ]( F
}[/mw_shl_code]
0 }: }* x9 o+ n4 P8 W |
|