# Addattribute / Connectable

**URL:** https://forum.highend3d.com/t/addattribute-connectable/1657
**Category:** Maya
**Tags:** mel
**Created:** [February 21, 2008, 1:20pm UTC](https://forum.highend3d.com/t/addattribute-connectable/1657 "2008-02-21T13:20:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![oodini](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/o/db5fbb/32.png) [@oodini](https://forum.highend3d.com/u/oodini)
#### Post date: [February 21, 2008, 1:20pm UTC](https://forum.highend3d.com/t/addattribute-connectable/1657/1 "2008-02-21T13:20:47Z")

</div>

Hello,

I'd like to use the addAttribute command to create a float attribute connectable to a shader.

In C++, I do that with :

CODE  
static MObject aZeroValue;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MFnNumericAttribute nAttr;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;aZeroValue = nAttr.create("zeroValue", "zv", MFnNumericData::kFloat);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nAttr.setConnectable(true);&nbsp;&nbsp;&nbsp;&nbsp; // default value anyway...  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nAttr.setDefault(0.0f);

So I get a float field, with on the right side a map button.  
I thought it was thanks to the setConnectable() function.

But how can I do that with the addAttribute command ?  
There isn't "connectable" switch, but this attribute is by default set to true.  
But there is no button created...

Thanks.
