- UID
- 804021
- 积分
- 139
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2020-9-16
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
You can use the following procedures to load linetypes. The LoadLineType (…) routine loads a specific linetype from the given linetype file, while the LoadLineTypes (...) routine loads all linetypes.
- public static void LoadLineType(this Database db, string LineTypeName, string LineTypeFileName)
- {
- try
- {
- string path = HostApplicationServices.Current.FindFile(LineTypeFileName, db, FindFileHint.Default);
- db.LoadLineTypeFile(LineTypeName, path);
- }
- catch (Autodesk.AutoCAD.Runtime.Exception ex)
- {
- if (ex.ErrorStatus == ErrorStatus.FilerError)
- AcadApplication.Editor.WriteMessage("\n"{0}" linetype file not found!", LineTypeFileName);
- else if (ex.ErrorStatus == ErrorStatus.DuplicateRecordName)
- AcadApplication.Editor.WriteMessage("\n"{0}" linetype loaded!", LineTypeName);
- else
- AcadApplication.Editor.WriteMessage("\n{0} linetype failed to load: {1}", LineTypeName, ex.Message);
- }
- }
- public static void LoadLineTypes(this Database db, string LineTypeFileName)
- {
- try
- {
- string path = HostApplicationServices.Current.FindFile(filename, db, FindFileHint.Default);
- db.LoadLineTypeFile("*", path);
- }
- catch (Autodesk.AutoCAD.Runtime.Exception ex)
- {
- if (ex.ErrorStatus == ErrorStatus.FilerError)
- AcadApplication.Editor.WriteMessage("\n"{0}" linetype file not found!", LineTypeFileName);
- else if (ex.ErrorStatus == ErrorStatus.DuplicateRecordName)
- AcadApplication.Editor.WriteMessage("\nLine types already loaded!");
- else
- AcadApplication.Editor.WriteMessage("\nErr: {0}", ex.Message);
- }
- }
复制代码 |
|