I'm not really sure what Autodesk Platform Services is or why I should use it, but Autodesk is pushing this hard it seems. The tech looks cool so I figured I would follow their first tutorial.

The first example they provide on APS is how to upload your local revit model to their cloud service and view the revit model in your web browser. Really cool! The example model shown in the gif above was the same model I built to show off the RAM to Revit tool.

A Return to Javascript

The documentation, found here on autodesk's github and the web example, is really well put together, I just made one stupid error that cost me about 4 hours of debugging and one stupid post to stackoverflow to try to solve. I have been meaning to come back to the concrete design tool for awhile which is written in javascript, so when I saw the tutorial recommended node.js and javascript as the first option, I hopped on the oppurtunity to refresh the javascript skills.

A few blog posts ago, I think I mentioned that one day I hope to experience less "firsts" in programming, this was a great example of less "firsts". I had played with all the tech stacks they utilized in the example, node.js, npm, javascript were all at least somewhat familiar to me. Finally! No watching 10 hrs of videos just to have a basic understanding of where we need to begin. 

Also, APS is built using three.js which I have experience with in building the about page on the website as well as the concrete design tool, how cool! It's crazy how all these tech stacks build on top of each other, finally starting to feel like a semi-experienced programmer.

APS Tutorial

As I had mentioned, the APS turorial was really well put together, but I will highlight a few things I found a bit unclear for my beginner programmer mindset.

First, make sure you are using powershell if you are on windows to input the commands in the documentation. Originally I was in git, which was not the right spot. The image below you can see git was working, but eventually I realized I needed to be in powershell.

The code is pretty advanced, so a lot of times where I had absolutely no I idea what I was copying and pasting. Throwing the code into chatgpt and asking it to explain it to me was helpful.

At the authentication step of the process, the docuemtation mentions that you should be greeted with a window that I was not getting. I should have realized that I had made a mistake and went back to fix it, but instead I forged (pun intended, APS used to be known as Forge) on to make my previous mistake much worse.

My mistake, in the .env file, you are supposed to store your APS_CLIENT_ID and APS_CLIENT_SECRET in a string. 
The code that is put up on the website looks like this:

APS_CLIENT_ID="<client-id>"
APS_CLIENT_SECRET="<client-secret>"

I replaced this as

APS_CLIENT_ID="<MYTESTCLIENT>"
APS_CLIENT_SECRET="<DKLJSADKNVDSLK15154541215F>"

Be sure to remove the "<" and ">", this stupid error led me down quite the rabbit hole trying to debug. See my stupid stackoverflow post here: 

https://stackoverflow.com/questions/78138283/autodesk-platform-services-access-token

My code is up on github, but it's just a copy of the autodesk code. Feel free to take a peek.
 

What's Next?

I've had people ask, why are you doing this? What's the end goal? Sometimes you don't need an end goal to enjoy the journey. For now, I'm going to keep going with the examples that are up on the APS github. It looks like there is some really cool dashboards that can be created and other exciting stuff. Again, nothing immediately jumps out as me as I need this to improve X/Y workflow, but I have to admit it is cool. 

Another item to research, how much will this cost? APS runs a currency called tokens. How much are tokens? How many tokens are consumed? I've got a lot of questions that I need to dig into to understand a bit more. I have a feeling though, with a name like "tokens" its gonna cost a lot. Maybe it's one of those, if you have to ask, you can't afford it type deals? Let's hope not!

 

BIM Revit Javascript APS

Our Sidebar

You can put any information here you'd like.

  • Latest Comments
  • retug on ETABs API - More Examples (Database Tables) -

    Hi rajavardhan, are you not able to delete selected frames and walls based on section properties through the ETABs program itself? Or through the API? I could put together a few quick examples for you with the API if needed.

  • rajavardhan on ETABs API - More Examples (Database Tables) -

    Hi, I am not able to select frames and walls based on section properties in etabs v21 and then delete selected frames and walls..can anyone suggest me the code to do it use Excel VBA code 

  • retug on SAP2000 API Example -

    Thanks James, appreciate you taking a look at the blog.

    The stuff you have been making is really cool too, always happy to see more people making coding more approachable for the practicing structural engineer.

    The package you linked for SAP2000 looks good, I will have to check it out.