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

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

[复制链接]

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

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

admin 楼主

2018-8-1 13:33:57

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

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

x
7 e" f; W- g9 D! ~1 u' Y

, J/ ]4 n& @9 p: U, F
; b1 Y# `# S+ ^6 Y$ F  E

, }! t! T( o  d" [% ~( PTechnique  
- C$ F8 S+ g) c# cThere are a few ways to get an Item when you know its id and type, the simplest
* ~! k, x+ V( A; b7 V5 D6 R4 ibeing the  Innovator.getItemById()  method.  However, if you need to be granular about . {: O8 B2 K+ w5 F) e5 @4 r
your request then building the query using the IOM is required.  This provides the
2 \' c2 ^8 |& L5 O. q/ sability to include controls to limit the results and define the structure to be returned
* {$ k! t8 {: X, j& g- K' Y: Ffor the Items found. $ x$ V4 `+ d) E5 E3 U
JavaScript  
+ G. e9 b" \+ {6 I, Nvar qryItem = this.newItem(myType,"get");
$ E0 ~9 f1 |0 H/ |$ f4 M5 qqryItem.setID(myId);
: k0 a7 \- |1 Svar results = qryItem.apply(); . y2 O! [# B- ~3 e

2 w3 N, x/ r+ n5 [3 u

7 H! ?! a2 C! E. a  j( y7 b0 E( wvar myInnovator = this.newInnovator(); 8 n7 p! J2 A; G$ M
var results = myInnovator.getItemById(myType, myId);
& x, G* j0 G6 U2 PC#  ' i  U2 |% }' b0 x1 ^6 q
Item qryItem = this.newItem(myType,"get"); - \4 K# |3 X; ]8 k) y3 Y
qryItem.setID(myId); 8 c, W0 l& S+ Y, [
Item results = qryItem.apply();   v8 ^) C1 s$ d$ ]! W+ H# n$ k5 T: c

8 K, l$ v2 C& ~1 g3 V( h. j! K6 [  A

8 z) e- h1 J6 T& S- R& u  [Innovator myInnovator = this.newInnovator(); 2 g# ]( x' x3 h8 l- o6 r
Item results = myInnovator.getItemById(myType, myId); / z& X- w! i. z: b( t* @
VB.Net  - J" H( v, R- o$ ?: J, y9 h( T
Dim qryItem As Item = Me.NewItem(myType,"get")
. [" e' b8 d$ Q* m" `7 P) a2 JqryItem.setID(myId) ! c1 F+ V9 g7 f+ L0 y  R) Y, \! B% c
Dim results As Item = qryItem.Apply()   _0 |0 P$ N: a+ Z9 n1 v
' o* d1 ]+ W6 U' i2 s+ \5 K9 E

3 n5 p+ M- V( r7 E3 KDim myInnovator As Innovator = Me.NewInnovator()
# f5 L  N/ H8 @1 r7 ~& L7 A( l! |, a5 CDim results As Item = myInnovator.GetItemById(myType, myId)
  v( Z% \3 t. [2 K7 U; c7 J0 A2 Y9 S3 w. `* b- G6 U

8 _7 k# C7 X" n8 G1 f( L5 @
+ R* S4 U) N/ r) A

2 [' x+ V3 T" r9 V7 H+ U
3 ]: w, P0 N# }* l4 H
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了