Jump to content
Developer Wiki and Function Reference Links ×

Vectorscript with AI


Recommended Posts

Recently, I've been using ChatGPT and eventually Github Copilot to write scripts for Google Apps and have had tremendous success. Unbelievable even. I am not a programmer, absolutely hate Javascript but I've been able to automate things with spreadsheets that I've needed for years. Naturally this gave me the idea of creating some custom vectorworks plugins that I've also wanted forever but I have not had similar success.

 

I've directed ChatGPT to the vectorscript documentation and it told me that its based on Pascal. For real? Pascal from the 1960's? I pointed out that it can also use python (which I am a little familiar with) and it then started using python. But even trying to make a very simple plug in, it just gets stuck in a loop of errors. I do not have the time, patience or desire to learn how to do this on my own, so if I can't get AI to do at least 80% of the work for me, it aint gonna happen.

 

So my question is, has anyone had better luck using any of the other LLMs to write vectorscript tools?

Link to comment

From what I have seen of ChatGPT and Vectorscript, it does not have enough training material to be useful in writing scripts.

 

Almost every case where I have seen someone ask ChatGPT to write a script, it has generate code that looks good, but that uses Functions and Procedures that don't actually exist.

 

You MIGHT have better luck using ChatGPT to write PythonScript instead of VS, but I doubt it. It is the Vectorworks specific functions that it does not understand.

 

But for explaining how a specific function in VS works, or how a script works, ChatGPT seems to work ok for that.

  • Like 2
Link to comment

AI is only as good as good as its training input, and Vectorscript just isn't well documented enough or have enough examples for AI to write accurate code. You can use it to help you on specific python tasks (e.g., how do I build and iterate over a list, etc.), but, at best it will probably hallucinate for specific Vectorworks tasks.

 

I would suggest trying to build your scripts with Marionette. You can both edit the code for Marionette nodes and export the whole network as a script -- AI may help you make custom modifications from there.

  • Like 1
Link to comment

So I use GitHub Co Pilot within the PyCharm IDE for writing Python based plugins.

 

It’s definitely helpful and worth having, but as others have said it’s more for autocompletion of this rather than creating an entire plug-in on its own. The documentation available to it, just isn’t enough for it to understand what it’s trying to do.

 

I’ve had multiple instances of copilot making up commands out of thin air that look right, but are in fact completely fictitious.

 

A very handy tool if you already know what the vectorscript should be doing, but it’s certainly as it stands, I don’t see how I will ever be able to write plugins successfully on its own.

  • Like 1
Link to comment

I have only used Python so haven't tried with Vectorscript directly, but for Python, I do find it useful for two tasks.

 

I tend to use it at the start and the end of writing a plugin. When opening up a fresh Python file that I know is going to end up a few hundred lines long, sometimes it's hard to break the 'writer's block' and get started on the first line. I use it to give me a rough outline and structure. I then review anything that needs to change about the structure (i.e. whether there are slicker options for iterations, like ForEachObject), but generally it does a reasonable job. I then swap any Vectorscript functions it has fabricated itself for something workable.

 

Then, I find it useful when there's an annoying issue I just can't trace, i.e. debugging why something just won't exit a loop even though everything is telling me it should. It won't get it every time but it gets it often enough for sure.

  • Like 1
Link to comment

Thanks for the replies. I have had a little more success by directing it to this and a couple of other pages in each and every prompt. Without that it starts including functions that are not supported. But I still have not been able to have it write a simple plugin from start to finish. 
 

Trying the same approach with marionette is an an interesting idea. The first thing I tried to do was make a plug in that generated a 3D cube and then calculate the force required to tip that cube over using python and give the answer in the OIP and recalculate whenever the variables in the OIP are updated. It got as far as making a cube but no farther. 

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