Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution of the secondary development of Revit

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

According to the current procedure, there are several improvements

1 after each revit generation, the log will not be del. The next time it is generated, if you find that there is a log, it will not be generated again. By changing the name of the log to a timestamp, an independent log file is generated each time it is run.

Sample code

String date = DateTime.Now.ToLongDateString () .ToString () + DateTime.Now.ToLongTimeString ()

Date = date.Replace (":", "_")

Roller.File = @ "EventLogByrevit" + date + ".txt"

This code is placed in log.cs. Execute in the command of revit. This method is useful when debugging.

2 in the Model class, add a library that drop the original each time, and regenerate a library separately.

Added to the constructor in the Model class

Database.SetInitializer (new DropCreateDatabaseAlways ())

3 add a time field to DB to see when the data was saved.

4 add a file name field to DB, which is the full-text file name, so when setting this property in the class, keep it about 1000 characters. Otherwise, some of them will be very long and will make a mistake when keeping them.

5 when maintaining, because there are more builds, download the build from the website

On the console of Negut, execute the following command

Install-Package Z.EntityFramework.Extensions-Version 3.22.6

An Extension is installed, which supports batch retention.

6 if the amount of data is still very large, then the data is divided into 10000 units. The method of dividing can be referred to.

List templist = new List (); int separate = 10000; int mod integers = count / separate; int mod remainder = count% separate; for (int j = 1; j

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 278

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report