mwuebker Posted March 24, 2020 Share Posted March 24, 2020 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 Quote Link to comment
Pat Stanford Posted March 24, 2020 Share Posted March 24, 2020 =CONCAT('TrussItem'.'Width', " x ", 'TrussItem'.'Height', " x ", 'TrussItem'.'Length') in the header row. Replace the commas with semicolons if your localization requires. 1 Quote Link to comment
mwuebker Posted March 24, 2020 Author Share Posted March 24, 2020 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! Quote Link to comment
markdd Posted March 24, 2020 Share Posted March 24, 2020 =(('TrussItem'.'Width')*('TrussItem'.'Height')*('TrussItem'.'Length')) This has just given me correct result? Quote Link to comment
mwuebker Posted March 24, 2020 Author Share Posted March 24, 2020 Thanks for your reply Mark, I'm actually looking for the following output as text: 12" x 12" x 10' Quote Link to comment
Pat Stanford Posted March 24, 2020 Share Posted March 24, 2020 Can you post a sample file with a Truss Object in it so I don't have to change workspaces and hope I am creating what you are working with? 1 Quote Link to comment
markdd Posted March 24, 2020 Share Posted March 24, 2020 9 minutes ago, mwuebker said: Thanks for your reply Mark, I'm actually looking for the following output as text: 12" x 12" x 10' Ha! I did wonder!! 1 Quote Link to comment
mwuebker Posted March 24, 2020 Author Share Posted March 24, 2020 Thanks!Truss Test.vwx Quote Link to comment
Pat Stanford Posted March 24, 2020 Share Posted March 24, 2020 =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. 😉 1 Quote Link to comment
mwuebker Posted March 24, 2020 Author Share Posted March 24, 2020 Thanks! That did it. Lastly, how do you get it to output single and double quotes i.e. 12" x 12" x 10'? Quote Link to comment
Pat Stanford Posted March 24, 2020 Share Posted March 24, 2020 =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. 1 Quote Link to comment
mwuebker Posted March 24, 2020 Author Share Posted March 24, 2020 Did you try the double quote inside the ' x '? I did and it did't work... might have to do 'in. x '... Just tried it again and it Worked! Must of had it on the wrong side of the single quote. Thanks so much! Quote Link to comment
mwuebker Posted April 9, 2020 Author Share Posted April 9, 2020 @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! 1 Quote Link to comment
Pat Stanford Posted April 9, 2020 Share Posted April 9, 2020 If it works for you great. My eyes are not good enough to be able to tell the difference most of the time between a double quote and two consecutive single quotes, so I am always looking for a work around to give me a better visual difference. 🙂 Quote Link to comment
mwuebker Posted April 9, 2020 Author Share Posted April 9, 2020 Cool. Just wanted to give back what little I can at this point and let you know there was way to display a single quote in case you needed it in the future. Thanks again for your help on this! Quote Link to comment
Recommended Posts
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.