# Inserting multiple times the same variable position waypoint

**URL:** <https://forum.universal-robots.com/t/inserting-multiple-times-the-same-variable-position-waypoint/13164>\
**Category:** URCap Development\
**Created:** [March 24, 2021, 9:13am UTC](https://forum.universal-robots.com/t/inserting-multiple-times-the-same-variable-position-waypoint/13164 "2021-03-24T09:13:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.parent.alonso](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@david.parent.alonso](https://forum.universal-robots.com/u/david.parent.alonso)\
**Post date:** [March 24, 2021, 9:13am UTC](https://forum.universal-robots.com/t/inserting-multiple-times-the-same-variable-position-waypoint/13164/1 "2021-03-24T09:13:41Z")

</div>

Hi all,

I’m developing an urcap that inserts a program tree for my application. In the program tree there is a sequence where the robot should move to a pose stored in a variable, so I am using variable position waypoints. The problem is that if I insert the node multiple times I obtain “MoveJ PreGraspPose”, “MoveJ PreGraspPose\_1”, “MoveJ PreGraspPose\_2” as you can see in the photo and the variables PreGraspPose\_1 and PreGraspPose\_2 are not defined. Is there a way that I can force to always use the variable “PreGraspPose” and it doesn’t auto create \_1 \_2 variables?

Now I am using" .createVariablePositionConfig(variable,blendParameters,waypointMotionParameters) and the “variable” is a GlobalVariable created using "varFactory.createGlobalVariable(“PreGraspPose”);. The value of “PreGraspPose” is defined in the writer using writer.appendLine(“global PreGraspPose = p[…]”);

Thanks

![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/0/098a4daef77e38bdbc163a77fabc43451f188ea0.png)

---

<div class="post-metadata">

**Author:** ![anon507564](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@anon507564](https://forum.universal-robots.com/u/anon507564)\
**Post date:** [March 24, 2021, 1:38pm UTC](https://forum.universal-robots.com/t/inserting-multiple-times-the-same-variable-position-waypoint/13164/2 "2021-03-24T13:38:13Z")

</div>

I’ve never created a URCap so I’m clueless there and if you already know the below, my apologies up front:

In Polyscope you can either copy and paste the same variable to a new node and it will not increment the name, or you can create a new variable then assign it’s position by linking it to an existing variable from the dropdown (see below).

With those two options I would imagine URCaps has a function to either copy/paste the waypoint, or apply values from those linked waypoints.

Hope this helps.!

[20210324\_062804|690x356](https://forum.universal-robots.com/uploads/short-url/hBoBXEnW8XO0FLZROdM3DR8MhZZ.jpeg)

---

<div class="post-metadata">

**Author:** ![david.parent.alonso](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@david.parent.alonso](https://forum.universal-robots.com/u/david.parent.alonso)\
**Post date:** [March 25, 2021, 7:54am UTC](https://forum.universal-robots.com/t/inserting-multiple-times-the-same-variable-position-waypoint/13164/3 "2021-03-25T07:54:56Z")

</div>

Thank you @anon507564. Yes, I can manually change the variable in polyscope but my idea is that the urcap generates the program tree without the \_1 and \_2, so that the final user has not to change this error manually.

---

<div class="post-metadata">

**Author:** ![david.parent.alonso](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@david.parent.alonso](https://forum.universal-robots.com/u/david.parent.alonso)\
**Post date:** [March 26, 2021, 8:13am UTC](https://forum.universal-robots.com/t/inserting-multiple-times-the-same-variable-position-waypoint/13164/5 "2021-03-26T08:13:52Z")

</div>

Yes, sorry for the misunderstanding, now I see your point.

> [@anon507564](#):
>
> there is probably a different way to create the waypoints in URCaps or to link them to an existing waypoint. Or maybe there’s a switch in URCaps with will allow duplicate names without adding numbers to every new one.

This is exactly what I am looking for! But I don’t know how to do it and I haven’t found information on the internet.

> [@anon507564](#):
>
> I guess I should probably stop trying to help people when I don’t know the specifics of the applications being used. 🙂

Not at all! Any help is welcome, thanks!

---

<div class="post-metadata">

**Author:** ![anon1685521](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon1685521](https://forum.universal-robots.com/u/anon1685521)\
**Post date:** [November 16, 2022, 6:38pm UTC](https://forum.universal-robots.com/t/inserting-multiple-times-the-same-variable-position-waypoint/13164/6 "2022-11-16T18:38:58Z")

</div>

I am having the same problem in 3.15.8… I had all sorts of waypoint issues in a program in 3.11 so i upgraded, and then my waypoints exploded, with a unique one for each use… Now i am completely lost… It’s like something fundamental changed…

I didn’t understand what @david.parent.alonso was saying here regarding the \_1 and \_2… Is that implying that it’s some sort of “Instance” of a common waypoint?

In the below example of my situation:

1. Copy MoveL (Waypoint2) to a 2nd instance just below it

2. New instance of MoveL (Waypoint2) shows as a copy  
 ![2022-11-16 11_29_31-URSim_VIRTUAL-3.15.8.106339 Running - Oracle VM VirtualBox](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/a/a5f2885527e39d0e735355373f9e3b67cf6c20b1.png)

3. Edit the Name of the first instance of Waypoint2, and the 2nd Instance get’s renamed to Waypoint2\_1 (I tried to duplicate this for a screenshot, and could not Reproduce it… and ran into other issues… so I started over, with a new waypoint (Waypoint3)… Copied that one, and this time it pasted in as Waypoint3\_1.  
 ![2022-11-16 11_36_45-URSim_VIRTUAL-3.15.8.106339 Running - Oracle VM VirtualBox](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/d/dd962939ecea3e1b7843c1eef25fee27ba1354f0.png)

I am so confused, is this a bug, or am I doing something wrong using Copy/Paste?
