Universal Robots Forum

How to add Parent Node when child insert

Hello,

I want to implement a node where when insert that, pragmatically adding parent node into it. Basically looks similar behaviour to waypoint. Can someone help me on this?

Thanks

copy:

jbm did many good examples creating urcaps, I think there are some about ProgramNodes - did you check them?

I would try:
a) first click “myNode”
insert ParentNode and add child “myNode”

b) second click “myNode”
check: parentNode is available in tree and/or parentNode is selected => insert second entry “myNode” or new parentNode with child: myNode

Currently I am not sure if functions like “is selected” and “request complete tree” are available but this would be my my first approach (API: com.ur.urcap.api.domain.program.*)

Maybe someone of the UR-Team could give us a short answer. possible: yes/no :slight_smile:

regards
mike

Thanks @m.nagel. :slight_smile:

Hello @jbm , Please kindly help me on this.

@kamprasad2007

In the latest API (1.9.0) there are no options to insert a parent node, to a child node being inserted.
I.e. you cannot mimic the special behavior Waypoints have, inserting a Move if not already a child of one.

If you have a node, that needs to be a child of a special parent, you can make the child node “NonUserInsertable”.
In that case, the user cannot insert the child directly from the tree. The user should then insert the parent node, and directly from the parent node, insert the child (i.e. like CircleMove under MoveP, or Cases under Switch).

Thanks @jbm
Are you planning to releaser this requirement as feature in upcoming API release ? Because this kind of node handling is really required for URCap developers like us.

Cheers,
@kamprasad2007