ibenjamin.price Posted October 6, 2016 Share Posted October 6, 2016 I've been given a spreadsheet of about 150 lines of text as labels that I need to import as classes into a Vectorworks file. Im wondering if anyone has any experience with being able to do this without having to type each label in the file by hand the first time? Im aware of all the methods of being able to import classes from another VWX file, but my sticking point seems to be, that Im trying to generate the data from the spreadsheet. Maybe there is a way I can get the spreadsheet data into a program that exports DWG and then import that to VWX? Let me know if you have any ideas. Thanks! -Ben Price I'm currently running VWX 2017 on a Macbook Pro Late 2013 Model. Quote Link to comment
michaelk Posted October 6, 2016 Share Posted October 6, 2016 This sounds very familiar. There was a previous thread about this exact question: You can copy / paste the from the spreadsheet cells to worksheet cells. Then select the cells of the worksheet and run the script in the thread. hth mk Quote Link to comment
michaelk Posted October 6, 2016 Share Posted October 6, 2016 Arrrrgggg. The files are still missing from the old forum. Let me know if you need the file. I might have it on this computer. hth mk Quote Link to comment
ibenjamin.price Posted October 6, 2016 Author Share Posted October 6, 2016 Haha, wow. I searching for classes from Spreadsheet so this never came up! :-) Thanks so much for the help. If you have the file, i'd appreciate it, but if not, no worries, I should be able to get my head around implementing this script. Thanks again. Quote Link to comment
michaelk Posted October 6, 2016 Share Posted October 6, 2016 I'm on the road at the moment, I don't seem to have them on this computer. @JimW, could you bring the files from the old forum in the above thread into this thread? Thanks mk Quote Link to comment
ibenjamin.price Posted October 6, 2016 Author Share Posted October 6, 2016 Copy that. No worries. Hopefully@JimWcan upload those quick. Thanks again for the help! Quote Link to comment
Pat Stanford Posted October 6, 2016 Share Posted October 6, 2016 Or, you can put the class names into a Text file, run the following script. The first file navigation is to the file containing the class names. Make sure the list is a true text file (not a XLS or DOC or some other format). One Class Name per line. An example file is attached. Procedure TextFiletoClasses; {©2016 Pat Stanford, October 5, 2016} {Licensed under the Lesser GPL} {Use and modify as you see fit} {No warranty expressed or implied} {Make make user drowsey} {Do not use with other medications} {See your doctor if side effects occur} {Tested in VW2017} Var FileName:String; S1:String; Begin GetFile(FileName); open(FileName); while not EOF(FileName) do begin ReadLN(S1); NameClass(S1); end; Close(FileName); End; Run(TextFiletoClasses); Class_Import_Test.txt Quote Link to comment
Marionette Maven Marissa Farrell Posted October 6, 2016 Marionette Maven Share Posted October 6, 2016 @michaelk I'm attaching your files. I've also updated your post on the other thread to include them. classes_v2015.vwx classes_v2016.vwx 1 Quote Link to comment
markdd Posted October 6, 2016 Share Posted October 6, 2016 This script is great! Thanks for sharing. Quote Link to comment
ibenjamin.price Posted October 6, 2016 Author Share Posted October 6, 2016 (edited) On October 6, 2016 at 0:39 AM, michaelk said: Arrrrgggg. The files are still missing from the old forum. Let me know if you need the file. I might have it on this computer. hth mk Sorry Michael, Im not so savvy yet with plugins and scripts. Is there a Tut or video somewhere showing me what I should do with this VWX file in order to get this to work?? Tried copying and pasting the script text from the other post into a new script in my plugin manager, but I keep getting an error... Sorry for all the needy hand holding. Any help is appreciated... -Ben Price **** CORRECTION **** I wasn't looking in the right place. The script is in the resource browser in the attached file and everything works like a charm! Thanks very much @michaelk Edited October 7, 2016 by ibenjamin.price Quote Link to comment
Pat Stanford Posted October 6, 2016 Share Posted October 6, 2016 57 minutes ago, ibenjamin.price said: Sorry Michael, Im not so savvy yet with plugins and scripts. Is there a Tut or video somewhere showing me what I should do with this VWX file in order to get this to work?? Tried copying and pasting the script text from the other post into a new script in my plugin manager, but I keep getting an error... Sorry for all the needy hand holding. Any help is appreciated... -Ben Price For the script I posted, you don't need to use the Plugin Manager. Just go the the Resource Manager (or Resource Browser in 2016 and earlier). Make sure you are in the current file and make a New Script. You will be asked to give the script folder a name first and then you will get a blank script. Paste the script from above in and close the window. The Script Palette should be open. Double click on the script in the palette to run it. Quote Link to comment
ibenjamin.price Posted October 7, 2016 Author Share Posted October 7, 2016 Hey Pat, Thanks so much. I managed to figure out the other solution. Just didn't look in the resource browser, which was where the script was... duh :-) I like the solution you have proposed here, only reason the worksheet solution seems better to me is that it will import the spreadsheet that I already have made, so no reformatting of stuff... Unless, would your solution work for a CSV file? Really appreciate the help everyone! Quote Link to comment
Pat Stanford Posted October 7, 2016 Share Posted October 7, 2016 The script does not care what the file type is, just that each "class name" in the file is the only thing on a line. Take a look at the CSV file and see how it is assembled. It may work. 1 Quote Link to comment
michaelk Posted October 7, 2016 Share Posted October 7, 2016 Glad you got it to work. Pat- that is one elegant solution! mk 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.