1、如果尚未在计算机上启动 Revit,请执行以下操作:
- 为当前位于 UserDataCache 文件夹中的 Revit.ini 文件创建备份副本(C:\ProgramData\Autodesk\<产品和版本 >\UserDataCache)。
- 将自定义的 Revit.ini 文件复制到 UserDataCache 文件夹。
- 启动 Revit。
启动软件时,UserDataCache\Revit.ini 将复制到用户配置文件夹
2、如果已经在计算机上启动 Revit,请执行以下操作:退出 Revit。 将自定义的 Revit.ini 文件复制到用户配置文件夹(C:\Users\<用户名>\AppData\Roaming\Autodesk\Revit\<产品名称和版本>)。 启动 Revit。 启动软件时,存储在用户配置文件夹中的 Revit.ini 版本将用于定义 Revit 设置。
3、读写ini的主要方法
[DllImport("kernel32")]
private static extern long WritePrivateProfileString(string section,string key,string val,string filepath);
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section,string key,string def,StringBuilder retval,int size,string filePath);
4、ini中主要属性介绍
颜色:定义了软件中在多个区域、情景、状态下的颜色显示
[Colors] BackgroundColor=16777215:绘图区域的背景颜色 HiliteColor=12401408:绘图区域中选定的图元的显示色 PreHiliteColor=12401408:该颜色用于在绘图区域中将光标移动到某个图元上方(尚未单击将其选中)时显示该图元 ErrorColor=33023:该颜色用于高亮显示与警告或错误相关的图元 CustomColor 设置对应可在 Windows 颜色对话框中定义的 16 种自定义颜色。 使用这些颜色对自定义颜色进行预定义。 然后在软件中,就可以将颜色分配给线样式、材质、颜色方案和其他属性。 CustomColor1=000000 CustomColor2=0000ff CustomColor3=00ffff CustomColor4=00ff00 CustomColor5=ffff00 CustomColor6=ff0000 CustomColor7=ff00ff CustomColor8=13f9e1 CustomColor9=d3adc0 CustomColor10=3abfe0 CustomColor11=8afdcf CustomColor12=7c8d98 CustomColor13=155bc6 CustomColor14=858585 CustomColor15=121eaf CustomColor16=7e4774
只有CustomColor使用的16进制颜色,其他的需要用rgb值进行转换:
颜色值 = (65536 * Blue) + (256 * Green) + (Red)
目录:
ProjectPath:
对应“选项”对话框>“文件位置”选项卡上的“用户文件默认路径”选项。
Type = string(字符串)
示例:ProjectPath=%USERPROFILE%\Documents\
MaterialLibraryFiles:
定义材质相关的文件的位置。
Type = string(字符串)
默认值:"..\Data\Rendering"
[Recent File List]
部分列出了最近在 Revit 软件中使用或打开的文件。
指定 15 个最近使用的文件(包括项目、族和其他 Revit 文件)的路径和文件名。
最后使用的文件指定使用 File1。 最早使用的文件则为 File15。 每次打开文件时,打开的文件将变为 File1,其他最近使用的文件则在列表中下移。
Type = string(字符串)
[DirectoriesCHS]
样板文件:
FamilyTemplatePath:族样板
DefaultTemplate:项目样板