博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Delmia DPE开发-常用函数
阅读量:4538 次
发布时间:2019-06-08

本文共 2024 字,大约阅读时间需要 6 分钟。

函数对象说明

1.id = Application.EntryObjectId

说明:Application:对象; EntryObjectId:方法
2.baseid = Data.GetAttributebyId(id, "ergocompbase")
说明:id:DPE客户端可以获取的参数; Data:DPE客户端提供的类; GetAttributebyId:Data对象的方法

初始化处理

1.一般初始化:Call Data.ResetIterator(Parentid,ChildListName)
    用途:在遍历父、子节点、关联节点、版本等前需要做次处理;
2.彻底初始化:Call data.resetitem()
  用途:1)当用户在其他项目中创建新对象时,同一程序中不能遍历到;
        2)对于同一个程序中刚刚升版的对象不能遍历到;

常用函数讲解

1.属性获取:attr=Data.GetAttributebyId(Baseid,PtsName)   
    参数:1)Baseid:节点的baseid;
        2)需要获取的属性对应的PTS名称;
  注意:节点类型”plantype_name”
  属性赋值:call Data.SetAttributebyId(Baseid,PtsName,Value)  
  参数:1)Baseid:需要属性赋值的节点的baseid;
        2)PtsName:需要赋值的属性对应的PTS名称;
        3)Value:需要赋的值;
  属性赋值2:Call Dialog.PropSetValues(Baseid, PtsName, 0, Value)
  区别:该功能可用于对刚刚创建但还未保存的节点进行属性赋值。
2.获取子节点、获取父节点、获取关联节点、获取同层节点:
    call Data.ResetIterator(parent_id, childlistname)   
            child_id = Data.GetFirstChild(parent_id, childlistname)  
    child_id = Data.GetNextChild(parent_id, childlistname)  
   参数:parent_id:节点的id
              childlistname:关系
1)遍历子节点时,值为”nodes”;
2)遍历父节点时,值可为“nodes_reverse_explicitandimplicit_ro” 、
”relationobject1”、"ergocompbase_parent"等
3)遍历P、P、R节点之间的关联节点时,值为对应的关联关系
4)遍历同层节点之间的关联关系时,值为对应的关联关系
注意:第一个参数通常用parent_id(因为Component节点下的一个节点baseid可能对应P、P、R结构树上的多个节点id)
3.创建节点:id = Data.CreateComponent(parent_id, childlistname, plan_type)
    参数:parent_id:父节点的id;
               childlistname:值为”nodes”
               plan_type:值为子节点的节点类型;
               id:值为创建的节点的id值;
  删除节点:call Data.DeleteComponent(idOrBaseid, delete_flag) 

 

4.添加子节点:id = Data.AddComponent(parent_idOrBaseid, comp_Baseid, childlistname)  

  参数:id:添加关联关系后的节点的id;
        parent_idOrBaseid:父节点的id或Baseid;
        comp_Baseid:子节点的Baseid;
        childlistname:1)若添加父子关系,值为”nodes”;
                       2)若添加关联关系,值为对应的关联关系。
  剪切子节点:call Data.RemoveComponent(parent_id1, id, childlistname)
                 id = Data.AddComponent(parent_id_2, id, childlistname)
     参数:
   注意:RemoveComponent方法慎用(RemoveComponent必须和AddComponent方法配合使用,若是仅需要移除子节点可用DeleteComponent)
5.复制节点:id = Data.CopyComponent(parent_idOrBaseid, comp_Baseid, flag_copy)

6.提交事务:call Data.CommitTransaction(baseid) 

7.回退事务:call Data.RollbackTransaction(baseid)

 

转载于:https://www.cnblogs.com/chen-20171203/p/9712792.html

你可能感兴趣的文章
【翻译】西川善司「实验做出的游戏图形」「GUILTY GEAR Xrd -SIGN-」中实现的「纯卡通动画的实时3D图形」的秘密,前篇(2)...
查看>>
mysql 5.6 参数详解
查看>>
求旋转数组的最小元素
查看>>
Gson解析Json数组
查看>>
Lintcode: Fast Power
查看>>
Pocket Gem OA: Log Parser
查看>>
枚举也能直接转换为对应的数值输出
查看>>
angularjs1-7,供应商
查看>>
BitSet
查看>>
Spring常用注解,自动扫描装配Bean
查看>>
(转载)深入理解WeakHashmap
查看>>
JAVA中的数组
查看>>
爬虫—使用Requests
查看>>
scrollIntoView()窗口滚动
查看>>
No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
查看>>
使用ansible远程管理集群
查看>>
读jQuery源码释疑笔记3
查看>>
手把手教你jmeter压测--适合入门
查看>>
Sequelize+MySQL存储emoji表情
查看>>
RabbitMQ学习之Publish/Subscribe(3)
查看>>