|
@@ -174,7 +174,7 @@ namespace SmartSoft.ACAD
|
|
|
try
|
|
|
{
|
|
|
var mbiDoc = TestCad.Model.Document.CreateDocument();
|
|
|
-
|
|
|
+ #region BlockTable
|
|
|
foreach (dbx.AcadEntity entity in thisDrawing.ModelSpace)
|
|
|
{
|
|
|
if (entity is dbx.AcadBlockReference blockReference)
|
|
@@ -242,11 +242,11 @@ namespace SmartSoft.ACAD
|
|
|
}
|
|
|
else if (entity is dbx.AcadSolid solid)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
else if (entity is dbx.AcadPoint point)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
else if (entity is dbx.AcadArc arc)
|
|
|
{
|
|
@@ -262,7 +262,7 @@ namespace SmartSoft.ACAD
|
|
|
}
|
|
|
else if (entity is dbx.AcadAttribute attribute)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -278,6 +278,23 @@ namespace SmartSoft.ACAD
|
|
|
}
|
|
|
|
|
|
}// end of foreach thisDrawing.ModelSpace
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region LayerTable
|
|
|
+
|
|
|
+ foreach (var entity in thisDrawing.Layers)
|
|
|
+ {
|
|
|
+ if (entity is dbx.AcadLayer layer)
|
|
|
+ {
|
|
|
+ var cadObject = new TestCad.Model.Layer();
|
|
|
+ cadObject.Handle = layer.Handle;
|
|
|
+ cadObject.Layer = layer.Name;
|
|
|
+ cadObject.IsOff = layer.LayerOn;
|
|
|
+ mbiDoc.AddObject(cadObject);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
mbiDoc.GroupElements();
|
|
|
string dataStr = JsonConvert.SerializeObject(mbiDoc);
|
|
|
string fileName = DateTime.Now.ToString("yyyyMMddHHmmss");
|
|
@@ -292,7 +309,7 @@ namespace SmartSoft.ACAD
|
|
|
System.Windows.Forms.MessageBox.Show("图形中有未知的错误,格式不正确或图形数据库需要修愎。系统错误提示:" + e.Message, "信息", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
|
|
|
thisDrawing = null;
|
|
|
}//end of catch
|
|
|
-
|
|
|
+
|
|
|
}//end of function GetBlockReference
|
|
|
|
|
|
#endregion
|