Catia macro connection with database

CATIA macro connection with database

database is an organized collection of data, generally stored and accessed electronically from a computer system.

Database

Introduction

If you want to make CATIA Macro connection with database you need some basic info. So this paragraph will be just simple introduction to the database. On the beginning it is important to say that this post has been written without a lot of knowledge about databases. Definition of database on Wikipedia is: A database is an organized collection of data, generally stored and accessed electronically from a computer system. You can read more about database on Wikipedia. There are a lot of resources about it. 

Considering that, we started to think how to integrate it in our CATIA macro application. Can you make CATIA macro connection with database? 

Database integration ideas

On the beginning we want to say that our application is written in Visual Basic. So we started searching for more info about free online databases. We found database from Google called Firebase. Firebase is a mobile and web application development platform developed by Firebase, Inc. in 2011, then acquired by Google in 2014. It was very hard to found some VB code to connect with the Firebase. After a while we found one Italian blog. 

Users

The goal was to create users for macro application with user name and password. We found this post about that.

It was little bit hard to understand but at the end the goal was achieved. 

End result will be previous picture that have two fields, one with  username and other with password. User name in this case is PC name. We manually created profiles with usernames and passwords. Profile picture for users are stored locally but you can also store it online.  Therefore in this case user needs to get password so they can log in the application. After entering a password user will click on the login button. Consequently application will connect to the database and check password for the user. 

Also you can make Sign Up part so users can make profile with username and password. 

Data collection

Now with created users we want to collect some data from every user and store it to the database. Our CATIA macro application has a lot of macros inside, so we want to know usage of the macros. Aim is to help our users to make macros better. So if someone doesn’t use a lot of macros you should speak about it. Problem can be in understanding or in macro itself, and those two must be differentiated. 

So how this works? Every user has own profile with counters for every macro. Also there is global counter for all users. For example when user run one macro, it will connect to the database and increase value of that user and increase global value for one number. Diagram is made to read those global values, but also it can be made for every user.

Chat

One more example on database integration is chat. We just make simple chat, in this case, for small number of users. So for example you can write about current project and so on. You can check code for it on this blog post.

This was simple implementation of database, although of course there are a lot of other possibilities. All of this was achieved just by using that blog post. We hope that we helped you a little bit, to open your eyes. 

If you have any issues feel free to contact us.

Leave a Reply

Your email address will not be published. Required fields are marked *