Jump to content

Importing a List of Classes from a Spreadsheet


Recommended Posts

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. 

Link to comment

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

Link to comment
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 by ibenjamin.price
Link to comment
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.

Link to comment

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!  

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