How to create Revit add-in and save data in external database? - c#

I would like to create a Revit addon that loads some data from Revit model and assosiates them with user entry data. Is there a way to save this associations in the project for future use?Do I have to create a database that keeps these associations, like a local SQLLite or a file localy?
Thank you in advance!

These are several different questions at once.
How to create a Revit add-in is described in numerous tutorials and other material, much of which is listed by The Building Coder overview of the Revit API getting started material.
There are many ways to associate user data with Revit model elements. You can store it in an external database, as you suggest, using either the Revit element id or unique id to maintain an association.
You can also store user data on individual elements within the Revit model by adding it to a shared parameter or using extensible storage.
I would suggest you work through the getting started material and learn the fundamentals of the Revit API and also the relevant Revit end user workflows for your use case next.

Related

Fill a gridview or matrix and a button saves it in the database c# SAP Business One SDK

I use Visual Studio with SAP Business One SDK.
In this example I used a GridView and a simple select on the POR1 table but what I would like to do is that when I fill in a GridView or a matrix what I write registers in the database so in the table por1, I made the example on both fields in the red frame (Photo Attachment).
Please, what do I do so that what I write here is stored in the database in the table por1 and in the fields U_QtyEnCours and U_StatutMarch?
There's a few ways to do this.
The first is using a direct SQL write - this is the fastest and is allowed for UDFs, but may be frowned upon depending on who your SAP Partner is. You also won't get any History logging.
You can use the SAP-DI Documents object to iterate over the Purchase Orders, and update the lines one by one - this is logged, but can be slow.
You could also just export it to a file and update it using the Data Transfer Workbench (DTW) which is logged, and also has all the error handling built in.

Hosting my own Google Analytics solution

I want to collect, store et report tracking datas (like used features, clicked buttons, ...) using javascript library and .net API. I know Google Analytics will be perfect for this. But my direction doesn't want to use it for privacy and security reasons. So i have to develop one or use an all-in-one package (piwik maybe).
Do you have any tips for me ?
Thanks
You could use ID's these are allowed to use as long as google cannot identify the user behind it, so a system which uses the id's in GA to obtain more information about a user can be very useful solution.
Since your direction does not want to use GA you could create it yourself.
It has been done at my company for certain situations.
I will not do your homework but the concept of it is :
Send calls to a homemade webservice (json format is pretty good for this),
create the service so it can interpret the json and put the raw data in a temporary Database. Do data checks , merges with backend data and possible conversions and store everything in a database from where you will make your reports.

How to programmaticaly change the path of a msaccess linked table

I´m looking for a solution to do so using c#.
I have 2 msaccess db and I copy them to user´s machine at the firt execution of the system. Between these dbs I have a linked table which I need to change the path to the user folder.
I´ve looked around but I couldn´t find anything.
Any help will be appreciated.
I had this problem some time ago while using VBA, which is probably easier to interface with Access than using C#.
However, after trying out several unreliable options I ended up just dropping the link and creating it from scratch. I would first retrieve all options used by the linked table, replace the database location and create a new linked table with those options, imitatng the old link.
After a quick search I found ADO.NET way for creating a linked table and How can I link an external Access table via .NET? that should help you with doing that in C#.

C# App database - small, miltiple-form application - forms need to exchange data via database

To give you some background, the project I am working on is a poker tournament manager. It uses two forms - the main form will display information throughout the tournament, such as players remaining, player names, stakes, payout structure, time left etc; and the other form will be used as a 'setup' form. Both of these forms are built and working, but I am struggling to get them to share data with each other.
What I want to do is load the setup form, select my options for configuring the tournament, and then clicking 'save' will assign all of my options to variables and then write these variables to a database of some kind (I'm new to DB design and I haven't used any DB objects in Visual Studio yet). The main form can then read the DB and display the relevant data. The benefits I can see of this is that the tournament setup can be saved for future use, and player stats can be accumulated over time.
What sort of database object do I need to create to store this data, and how do I open connections etc and write data to the DB?
I'd probably suggest that you use LINQ to SQL. ScottGu did an excellent series on blog posts on how to build a model with this. You only really need to read the first few for a simple CRUD application.
http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx
http://weblogs.asp.net/scottgu/archive/2007/05/29/linq-to-sql-part-2-defining-our-data-model-classes.aspx
http://weblogs.asp.net/scottgu/archive/2007/06/29/linq-to-sql-part-3-querying-our-database.aspx
http://weblogs.asp.net/scottgu/archive/2007/07/11/linq-to-sql-part-4-updating-our-database.aspx
http://weblogs.asp.net/scottgu/archive/2007/07/16/linq-to-sql-part-5-binding-ui-using-the-asp-linqdatasource-control.aspx
http://weblogs.asp.net/scottgu/archive/2007/08/16/linq-to-sql-part-6-retrieving-data-using-stored-procedures.aspx
http://weblogs.asp.net/scottgu/archive/2007/08/23/linq-to-sql-part-7-updating-our-database-using-stored-procedures.aspx
http://weblogs.asp.net/scottgu/archive/2007/08/27/linq-to-sql-part-8-executing-custom-sql-expressions.aspx
http://weblogs.asp.net/scottgu/archive/2007/09/07/linq-to-sql-part-9-using-a-custom-linq-expression-with-the-lt-asp-linqdatasource-gt-control.aspx
Reference: http://msdn.microsoft.com/en-us/library/bb425822.aspx

Using InfoPath for importing and exporting data

The application I'm writing has a need for a solution to the following situation:
Salesman and customer is located offsite. They are finalizing a list of requirements, and will input business data that at some point need to be inputed in the onsite database.
My idea is that the salesperson gets a InfoPath document that is almost completed with default values and heads over to the customer. While at the customer the document is updated to satisfy the customer's need. I must also cover that the document is passed back and forth by email between the salesperson and the customer.
When the salesperson returns to the office he uploads the InfoPath into the database and the order is updated with few user interactions.
Now to the questions:
Is this a workable/sensible solution? Other suggestions to how to solve this?
How do I ensure that form and data stays together when the salesperson takes the document on a USB stick or it's emailed to the customer?
How do I (with C# code) fill a form with default values?
How do I read back the changes?
Sharepoint is not an option.
Some issues that you will need to think about
will customer have infopath installed and therfore may not be able to view the document.
If you email the document or need a customer to view it, generally only the data is transmitted with a pointer to the Form Template. If you want the customer to update it and send it back, then the template will need to be located somewhere publicily accesseable.
The data is stored as an XML document so as part of the startup you could detect that it is a new form set the defaults that you need.
when you publish a form to a networked folder it will also ask for a local path for the form. this allows for a disconected scenarios.
From my experience, InfoPath is a great tool when you have control over the environment. It starts to break down as a viable option once you get outside a controled environment, because you then have to start jumping through hoops to make it work as it should.
EDIT
One you loose control of the environment I think that a web interface would be the way to go.
The sales person could create a new document on the website with the back-end populating all the defaults necessary. A link to the document could be emailed to the customer, who could update their stuff via the web interface and then sales person can then finalise the process.

Categories

Resources