Screwy scripting ??

Screwy scripting ??

RogerInHawaii
Collaborator Collaborator
404 Views
1 Reply
Message 1 of 2

Screwy scripting ??

RogerInHawaii
Collaborator
Collaborator

I want to write a Fusion 360 script, in C++.

I tried out a few of the existing sample scripts and they all work. In particular, the Test Script one does indeed make a dialog pop up that just says, "Test script".

Test Script.jpg
Since I want to write one in C++, and Fusion 360 does not appear to include an editor for C++ files, I installed Microsoft Visual Studio on my machine.

I then, in Fusion 360, clicked on "Add In>Scripts and Add-Ins" to bring up the dialog...

Test Script 1.jpg

 

which brings up the Create script dialog...

Test Script 2.jpg
I changed the destination folder so that it would go into MY OWN folder, NOT the default one that Fusion uses.
C:\My Projects\Mercury Capsule\Fusion 360 SCRIPTS.

I hit Create, and it created a basic C++ program, identical to the default "Test Script"  that simply shows a dialog showing the words "Hello script".

All well and good so far. I then chose to EDIT that newly create script so that, instead of showing "Hello script" in the dialog it will say, "Hello Roger".
Test Script 3.jpg

I save the change, close Visual Studio, open the file back up just to make sure the changes have been recorded properly and go back to Fusion 360.

 

 I again bring up the "Scripts and Add-Ins" dialog and select the script that I just created and edited, and instead of seeing "Hello Roger" I again see "Hello script".   WHAT???". What happened to the edit I had made to the script?

I click the Edit button and bring back up the script in Visual Studio and, sure enough, "Hello Roger" is there.

It's as if hitting the EDIT button for the selected script does indeed bring up the edited version of the script, the one that I placed in my OWN folder, but hitting the RUN button for the selected script runs a script (a copy of it, perhaps) residing in the default folder that Fusion 360 normally places scripts. Is the Run button not referencing the folder that I specified? Do I HAVE to accept the default folder as the place to put my Fusion scripts? If so, why even provide the user with the ability to specify a different folder.


Hmmm. I just tried doing it all again, but this time I did NOT specify a different folder for the file, I let it use the default folder where Fusion seems to want to put it. I made my edit to the file and saved it. Brought it back up to make sure the changes had been saved and it was all OK. I selected the script and hit RUN, and, oh no, not again, it still says "Hello script".

So it does NOT seem to be a problem with it not remembering where it is. It seems to ALWAYS somehow default to the Hello script version of the program. 

I am confused. Is it even possible to actually create a new script and then edit it so that it does something other than display "Hello script" ??

0 Likes
Accepted solutions (1)
405 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

@RogerInHawaii 

You did not mention that you performed a "Build" or "Rebuild" in Visual Studio to create an updated *.dll file (you have to do that, C++ is not a scripting language)?