Jump to content

Channel referencing inside of an expression's string input


Recommended Posts

Hello,

I'm trying to concatenate this channel:

ch("linkedname")

into this expression:

centroid("../geo_triple04/OUT_triple04", D_X)

Here's what I've tried, but haven't gotten it to work...

centroid("../geo_`ch("linkedname")`/OUT_`ch("linkedname")`", D_X)

centroid(strcat(""../geo_", ch("linkedname")+strcat("/OUT_", ch("linkedname")+", D_X)

centroid(( ""../geo_" + "`ch("linkedname")`" + "/OUT_" + "`ch("linkedname")`""), D_X)

centroid("../geo_" + `ch("linkedname")` + "/OUT_" + `ch("linkedname")`, D_X)

Have to replace many pieces of geometry so this could save me hours of time.

Thanks in advance!

Link to comment
Share on other sites

Hello,

I'm trying to concatenate this channel:

ch("linkedname")

into this expression:

centroid("../geo_triple04/OUT_triple04", D_X)

Here's what I've tried, but haven't gotten it to work...

centroid("../geo_`ch("linkedname")`/OUT_`ch("linkedname")`", D_X)

centroid(strcat(""../geo_", ch("linkedname")+strcat("/OUT_", ch("linkedname")+", D_X)

centroid(( ""../geo_" + "`ch("linkedname")`" + "/OUT_" + "`ch("linkedname")`""), D_X)

centroid("../geo_" + `ch("linkedname")` + "/OUT_" + `ch("linkedname")`, D_X)

Have to replace many pieces of geometry so this could save me hours of time.

Thanks in advance!

use the strcat() hscript expression, it concatenates 2 strings... not as handy as python's sintaxe, but it works and you can nest them to get your expressions to work.


centroid(strcat(strcat(strcat("../geo_", ch("linkedname")), "/OUT_"), ch("linkedname")), D_X)
[/CODE]

Cheers

Edited by rafaelfs
Link to comment
Share on other sites

use the strcat() hscript expression, it concatenates 2 strings... not as handy as python's sintaxe, but it works and you can nest them to get your expressions to work.


centroid(strcat(strcat(strcat("../geo_", ch("linkedname")), "/OUT_"), ch("linkedname")), D_X)
[/CODE]

Cheers

Perfect :) Had to use chs() instead of ch() for what I needed, but it worked!

Thank you!

Link to comment
Share on other sites

I'm trying to concatenate this channel:

ch("linkedname")

into this expression:

centroid("../geo_triple04/OUT_triple04", D_X)

How about ...

centroid("../geo_" + chs("linkedname") + "/OUT_" + chs("linkedname"), D_X)

  • Thanks 2
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...