PLM之家PLMHome-工业软件与AI结合践行者

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

[复制链接]

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

admin 发表于 2018-8-1 13:33:57 |阅读模式

admin 楼主

2018-8-1 13:33:57

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

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

x
+ D& L& `& D. U6 R- t: Y6 x- O6 E6 B9 o
" E2 i9 m5 u6 m% @3 _9 w7 D# A

2 X1 W* o* p3 n  f# r1 J
, S& W5 W- w5 t: X' H
Technique  
$ X' o0 I) E" M' [+ J7 m8 PThere are a few ways to get an Item when you know its id and type, the simplest % p. B- U0 U  {9 j! A. Z$ D# X2 w9 e
being the  Innovator.getItemById()  method.  However, if you need to be granular about " C8 h4 {/ x0 ~5 V* Q, K+ N7 n2 S
your request then building the query using the IOM is required.  This provides the
7 z) F, s& v# Y7 i& Nability to include controls to limit the results and define the structure to be returned 0 r, k2 T2 d, p9 r1 u8 c
for the Items found. : o  N+ w' @3 u/ w% z' m
JavaScript  
: g# f; C2 ^6 d7 ^3 T" b, ovar qryItem = this.newItem(myType,"get");
, d% p# ~+ [! A0 v  x% Q0 aqryItem.setID(myId);
0 D8 T: \* U$ K$ S) b: J9 F8 @+ ovar results = qryItem.apply(); ; u2 m' c* l* L9 f
/ I5 a8 x# g( h7 d3 {3 Z

( @" o) K% z+ d8 Pvar myInnovator = this.newInnovator();
4 y7 @3 k' f) z1 ?; Y8 Gvar results = myInnovator.getItemById(myType, myId);
5 d. `8 _# h! ^" e3 O0 y/ ~- j( `C#  
- \, x* K. {$ A1 R$ R# m+ f: eItem qryItem = this.newItem(myType,"get"); 5 T+ ^, ]3 p  M, i5 y# A
qryItem.setID(myId); ; d) n; V' R$ S; w! ?
Item results = qryItem.apply();
3 \+ I1 R3 r0 D1 N  V6 N9 N2 N) @' s" M
9 Y5 P1 l3 `! [
Innovator myInnovator = this.newInnovator(); ) c, b) w- }2 n1 z& s
Item results = myInnovator.getItemById(myType, myId);
5 D. R" f$ n1 i# \8 @' MVB.Net  5 d$ N$ T. v( A9 N2 `) L: _
Dim qryItem As Item = Me.NewItem(myType,"get") 8 K$ q) X4 R" ^( h" K8 b
qryItem.setID(myId)
  p5 u' ?7 c+ D" b2 z0 W% C' `! lDim results As Item = qryItem.Apply()
  l! `' ]& _# w" @$ K( x  {) h8 k
4 O( E( w/ D2 P  c  R

8 _  p! C5 V0 |/ ~Dim myInnovator As Innovator = Me.NewInnovator() 4 G8 l% f1 E' A0 T2 V
Dim results As Item = myInnovator.GetItemById(myType, myId)
; P$ ^+ h! t' K3 ~- v* G+ L% v( r, {8 ]9 x8 t: R, F
6 S2 u7 e$ Y: D/ C& |$ Y3 |

$ _+ K8 A& g8 W" j* W
3 c  @0 c" d6 @2 u6 L
! Z; |* Y' I1 @; o- I) x
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了