Jump to content

Multiple Field values in Work Sheet


Recommended Posts

Hey All,

 

Long time listener, first time caller. I have a question about Worksheets. I'd like to pull multiple field values into a single cell, kind like concatenate if I were using excel. Something like this:

 

='TrussItem'.'Width' & " x " & 'TrussItem'.'Height' & " x " & 'TrussItem'.'Length'

 

Is there a way to do this in a database row?

 

Thanks,

 

Marcus Wuebker

Link to comment

Thanks for the reply, Pat! I was hoping you would, I've read many of your posts the last several weeks. But this is not working for me. I've imported your Get PIO Names script and the fields referenced are Real - Coordinate Displacements. I tried =CONCAT(TEXT('TrussItem'.'Width'), " x ", TEXT('TrussItem'.'Height')' " x ", TEXT('TrussItem'.'Length')), but no go there too.

 

Speaking of your past posts, I found one from many years ago that linked to a list of functions for worksheets, but the link is no longer valid due to the rebuild of the forum. Do you know how I can find that again?

 

Thanks!

Link to comment

=CONCAT('TrussItem'.'Width', ' x ', 'TrussItem'.'Height', ' x ', 'TrussItem'.'Length')

 

You had double quotes around the Xs and an extra single quote outside and after the Height close paren.

 

Actually I had double quotes. I think that was an autocorrect problem, but maybe just my fuzzy brain.

😉

  • Like 1
Link to comment

=CONCAT(('TrussItem'.'Width')*12, '" x ', 'TrussItem'.'Height'*12, '" x ', 'TrussItem'.'Length', '´')

 

The *12 is to convert to inches.

 

For the Inch mark I just included the double quotes inside the strings with the Xs.

For the Foot mark I used the Accent Grave (Option-e on Mac) to simulate. Since the single quote is used for string delimiters, it is hard to force it to display properly in a worksheet formula.

 

If you need to limit the decimal places you could use something like:

 

INT(TrussItem.Width*100*12)/100 to round to two decimal places. Use 10 to round to one decimal place.

  • Like 1
Link to comment
  • 3 weeks later...

@Pat Stanford I was just reading through the VectorScript intro document and can across this gem: 

 

Quote

To write a single quote within a string literal, use two consecutive single quotes in the literal statement.

'VectorScript'

'Nemetschek Vectorworks'

'Section A-A'

'Provide approx. 3’’ clearance'

 

I tried the two consecutive single quotes in the concat formula and it worked perfectly!

 

  • Like 1
Link to comment

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.   Restore formatting

  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...