Hi, everybody now i am facing a problem, i want to from mysql read data and set this data to revit element parameter although I completed the mysql connection and set the parameters of the code,but i use timer1_Tick function to set parameters every second then revit crashes,i tried to use dynamo node to repeatedly read mysql data and use it to set element parameters,i think revit api can do the same thing.
You may ask me why not use dynamo, because when I use dynamo to do this, the program will be very slow so I want to try using revit api to do this
Can anyone give me some advice or sample code?
Thank you all
Solved! Go to Solution.
Solved by Revitalizer. Go to Solution.
Hi,
bad idea.
One update per second is way to much.
You will prevent the user from editing data manually, this way.
Also, you will pollute the undo stack, so the user will no be able to return to a given transaction within a couple of seconds.
Why not using the existing events, DocumentClosing, DocumentSaving, DocumentSavingAs etc.?
You still could trigger setting the parameters independent of any events - additionally, but not in a continuous loop...
Revitalizer
Sorry, my English is not very good. I still don’t fully understand what you gave me.
Let me talk about what I want to do first,i want to use api reach the effect of the following image,below image is i did it with dynamo node ,the process is like third image , but dynamo is too slow .
So if I want to achieve this effect,is it possible for me to use some events as you said?
I want to build click start button then program start, continue until I press the Cancel button,is this a good idea?
Hi,
if you just want to display data in a model, you could use the AVF:
You can create non-element geometry at runtime to get faces for displaying your values.
Note that you have more color and display options (color gradients, points, values, color legends) than you have using just
materials and plain colors.
What I meant by "undo stack" is this:
Every time you commit a transaction, there is a new entry in this list.
If you set parameters each second, there will be 60 entries after just a minute.
If the user is about to change another parameter and needs more than a second to do so, his changes will be rollbacked, as you can read in the forum topic I've linked.
I think the "Start" and "Cancel" buttons are a good way to show the user that he is in a sort of "playback mode", so he really knows that he cannot work on the model but can "enjoy the show".
Revitalizer
Can't find what you're looking for? Ask the community or share your knowledge.