# Expression/constrain a object position to curve cv position

**URL:** https://forum.highend3d.com/t/expression-constrain-a-object-position-to-curve-cv-position/47349
**Category:** Maya
**Tags:** rigging-character
**Created:** [September 9, 2015, 12:48pm UTC](https://forum.highend3d.com/t/expression-constrain-a-object-position-to-curve-cv-position/47349 "2015-09-09T12:48:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![andre\_xyz](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/a/6bbea6/32.png) [@andre\_xyz](https://forum.highend3d.com/u/andre_xyz)
#### Post date: [September 9, 2015, 12:48pm UTC](https://forum.highend3d.com/t/expression-constrain-a-object-position-to-curve-cv-position/47349/1 "2015-09-09T12:48:16Z")

</div>

Hello everyone,

I have an animated curve, and I’d like to constrain an object’s position to one cv of the curve.

Step #1, get cv position…I’ve been trying all day.&nbsp;but I’m getting nowhere, and keep getting values of 0.

I’ve seen mostly old postings and using what I can.

for example

string $position = curveShape3.controlPoints[3].zValue; ## results in 0

or

string $array[] = listAttr(“curveShape5.controlPoints[2]”);

print $array[3]; ##&nbsp;returns lables from [0-2], then the rest looks like 0s

anyone have some experience they can share?

---

<div class="post-metadata">

### Author: ![andre\_xyz](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/a/6bbea6/32.png) [@andre\_xyz](https://forum.highend3d.com/u/andre_xyz)
#### Post date: [September 9, 2015, 2:40pm UTC](https://forum.highend3d.com/t/expression-constrain-a-object-position-to-curve-cv-position/47349/2 "2015-09-09T14:40:07Z")

</div>

Hi, it’s me again,

I just figured out my mistake, and it’s not&nbsp;syntax or the expression.&nbsp; the curve that is animated is a nhair output curve.

because it is called a output curve I figured it would return the curve cv position, but it does not, only 0.

I tested by using another curve. Dead in my tracks on this avenue, but I can explore others.
