PLM之家PLMHome-工业软件践行者

【Aras二次开发】查询一个对象代码

[复制链接]

2018-8-1 13:33:57 1882 0

2470

主题

1275

回帖

8万

积分

管理员

PLM之家站长

积分
82172
QQ
发表于 2018-8-1 13:33:57 | 显示全部楼层 |阅读模式

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x

1 l* o. t7 f; m* m# H

5 g1 w" p" u: ~, R9 U  B& }9 M0 }$ H/ D) [# ?
$ g$ y- S+ _" k5 K0 a5 ]4 n
Technique  
, @( K3 w( _7 N/ r% t; L6 eThere are a few ways to get an Item when you know its id and type, the simplest
9 e4 [( p& e$ S/ [; a1 @/ \8 O3 ?being the  Innovator.getItemById()  method.  However, if you need to be granular about
1 V$ g- h9 J7 ]5 u" H3 Lyour request then building the query using the IOM is required.  This provides the
* k7 z% e2 J) M. o3 ]3 cability to include controls to limit the results and define the structure to be returned
/ B. Y! ]2 {1 M2 B0 |6 Dfor the Items found.   ?% X" i" }0 L& r0 C' p
JavaScript  " D4 Z; \* g3 m7 U
var qryItem = this.newItem(myType,"get"); & G4 S1 Q0 f1 L4 n2 D
qryItem.setID(myId);   w2 @% U# o: Z; P' R4 U
var results = qryItem.apply();
+ R4 q" O3 m, Z1 r7 W8 s, d& [
7 x2 E! f% q# D/ ]

0 g/ \6 R( e0 q" Jvar myInnovator = this.newInnovator();
/ E7 W' \) O, ]# kvar results = myInnovator.getItemById(myType, myId);
* z, F/ j. C2 @* E" i+ AC#  1 F5 g( D; _! v. N9 x
Item qryItem = this.newItem(myType,"get");
4 k/ S/ F- o, Y8 B5 eqryItem.setID(myId);
* p8 q) Z& m1 I9 Z) P$ E1 eItem results = qryItem.apply();
5 ~( m" C& X& L( F, V9 ?& d! |1 ^5 B) i; S' s: y

& y, x/ C, b* v+ `5 l6 iInnovator myInnovator = this.newInnovator();
" l: l$ N) z- p; v0 e, w* hItem results = myInnovator.getItemById(myType, myId); 9 ~* Q1 H8 a  A/ N" n" ^5 y+ i
VB.Net  $ ^' }( |* D8 y0 T4 N
Dim qryItem As Item = Me.NewItem(myType,"get")
" o/ S% |( c$ ?, l, ?" `8 RqryItem.setID(myId)
) i. H0 x, _/ o) ^Dim results As Item = qryItem.Apply()
& P' [) z# Y! y6 K. X5 y
6 C0 m1 ^' U6 ?  M- Y+ r
, u- S# ?$ t3 C2 z# r
Dim myInnovator As Innovator = Me.NewInnovator()
0 k8 [5 i4 K) H) t* c# k' `4 ]" gDim results As Item = myInnovator.GetItemById(myType, myId)
! ^' p# s3 M4 D3 T
0 u( |5 l- s% C' a. {7 A4 I$ L

4 [) D2 `" \. y. ]  x0 Z! V
# A6 }* V" i) j1 H$ G& K- T! v  \( k

1 y+ ]- G7 i! d: Z/ U. x. c3 }# u
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了