Jump to content

addattrib array problem


j00ey

Recommended Posts

Can someone demystify the docs for me regarding adding an array attribute with addAttrib? I found an example using addattribute but that's deprecated now and I can't figure out the syntax.

I can't do   f[]@arrayName;

because I need to loop through a number of points and for each point add an empty detail array.

This is what the docs say I should use -

"int addattrib(int geohandle, string attribtype, string name, float defvalue[])

defvalue provides the default value for the attribute and determines the type of attribute to create. String and array attributes cannot have defaults, so only the type is used in those cases."

If anyone knows could you fill in the ***s in this line? I've tried all sorts and nothing works.. Thanks very much

addattrib(geoself(), "detail", "test", ***);

Edited by j00ey
Link to comment
Share on other sites

Should always think before posting! I tried doing it in an Attrib VOP and found the correct form.

For anyone interested it works like this : 

addattrib(geoself(), "detail", "test", {});

and for strings this seems to work

addattrib(geoself(), "detail", "test", {""});

Edited by j00ey
extra info
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...