Jump to content
Developer Wiki and Function Reference Links Read more... ×

Recommended Posts

Posted (edited)

I need a file log. Until someone will add this feature, I want to try to write my own file log.

I mean a text file relate to the WORK file, not in general, as VW is use to write since the mincad release.

But I have no idea how to start. The technical (I mean code) in not the problem at the moment. 

I have, first, to understand the problem, starting with a simple code:

I'm thinking to write two tool script LogIN and LogOut, but I never wrote a simple txt file until now (in VScript, I mean)...

Another step could be an automatic script, that run each time I open the file project...

I have also tried to set a worksheet... but it doesn't works.

So, as you can easily understand, I have few ideas but... confused" 😋

Thank you

 

L.

Edited by lucioing

Share this post


Link to post

Are you looking to do something like write the file name and a date/time stamp to a text file? I would recommend looking at python for this, as both file writing and time stamps are far superior to the options in VS. You can also find a lot of tutorials on writing a text file via python.

 

vs.GetFName() will get the name of the current file.

 

Triggering the log automatically requires the SDK, so is possible but a bit more complicated

  • Like 1

Share this post


Link to post

1. There is no such thing as a script that runs automatically when you open or close a file in VW.  It has been asked for for years.

 

2. Writing data to the worksheet idea might be the best option. Take a look at the script(s) in the follow thread for an idea of how to create and access a worksheet and how to write data into cells.

 

I think I would start with a small worksheet and just insert a line every time I opened the file. That way the most recent data is always at the top and you always write into the same cell(s) instead of having to figure out how much data you already have.

 

Another way to do this would be to make a symbol with a Record attached.  When you Open the file, insert symbol instance and write the start time. When you get ready to close, write the stop time. You can then use a worksheet to report on the time in the file. Only problem is if someone deletes the symbol instances.

Share this post


Link to post

Thank you, for your precious reply. I'll try that way!

 

L. 😉

 

Share this post


Link to post
Posted (edited)

Here we are!

Just wrote two 'tool', one for start timer, to stop it the second.

When you start a new drawing/project, click on 'start' button tool (yes, you have to create a palette or add them to an existing one) and star to work.

When you stop your job, click on stop button and 'mark' the timer. Of course, you can do it every time you are working to the file...

I know it is far to be perfect, but it is just a begin.

Hope you like it.

Thanks to Pat, I want to share my little job so, any comment is welcome!

 

thank you again, Pat and JBenghiat

 

L.

Schermata 2019-06-16 alle 23.34.00.jpg

MyFileLOG_Start.txt

MyFileLOG_Stop.txt

Edited by lucioing

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×