Добавлены функции извлечения данных из dxf-файлов

This commit is contained in:
2022-12-05 17:31:27 +03:00
parent 4b2a01dd86
commit 52c8e3981f
3 changed files with 422 additions and 50 deletions

View File

@@ -1,6 +1,9 @@
using Autodesk.AutoCAD.Interop;
using Autodesk.AutoCAD.Interop.Common;
using netDxf;
using netDxf.Entities;
using SMath.Manager;
using SMath.Math;
using SMath.Math.Numeric;
@@ -12,6 +15,8 @@ using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.ToolTip;
namespace AcadToSMath
{
public class AcadToSMath : IPluginHandleEvaluation, IPluginLowLevelEvaluationFast
@@ -63,6 +68,47 @@ namespace AcadToSMath
new ArgumentInfo(ArgumentSections.String, true),
new ArgumentInfo(ArgumentSections.RealNumber, true)),
new TermInfo("GetDxfLines", TermType.Function,
"(1:путь к dxf-файлу, 2:слой, 3:масштаб единиц чертежа) - " +
"Получает координаты точек отрезков и их длину из dxf-файла, возвращает массив с данными отрезков.",
FunctionSections.Files, true,
new ArgumentInfo(ArgumentSections.String),
new ArgumentInfo(ArgumentSections.String, true),
new ArgumentInfo(ArgumentSections.RealNumber, true)),
new TermInfo("GetDxfPoints", TermType.Function,
"(1:путь к dxf-файлу, 2:слой, 3:масштаб единиц чертежа) - " +
"Получает координаты точек из dxf-файла, возвращает массив с координатами точек.",
FunctionSections.Files, true,
new ArgumentInfo(ArgumentSections.String),
new ArgumentInfo(ArgumentSections.String, true),
new ArgumentInfo(ArgumentSections.RealNumber, true)),
new TermInfo("GetDxfTextes", TermType.Function,
"(1:путь к dxf-файлу, 2:слой, 3:масштаб единиц чертежа) - " +
"Получает координаты точек вставки и содержимое однострочных текстов из dxf-файла, возвращает массив с данными текста.",
FunctionSections.Files, true,
new ArgumentInfo(ArgumentSections.String),
new ArgumentInfo(ArgumentSections.String, true),
new ArgumentInfo(ArgumentSections.RealNumber, true)),
new TermInfo("GetDxfCircles", TermType.Function,
"(1:путь к dxf-файлу, 2:слой, 3:масштаб единиц чертежа) - " +
"Получает координаты центров, площади и диамерты окружностей из dxf-файла, возвращает массив с данными окружностей.",
FunctionSections.Files, true,
new ArgumentInfo(ArgumentSections.String),
new ArgumentInfo(ArgumentSections.String, true),
new ArgumentInfo(ArgumentSections.RealNumber, true)),
new TermInfo("GetDxfPlines", TermType.Function,
"(1:путь к dxf-файлу, 2:слой, 3:масштаб единиц чертежа, 4:замкнуть полилинии) - " +
"Получает вершины полилиний из dxf-файла, возвращает массив с координатами вершин полилиний.",
FunctionSections.Files, true,
new ArgumentInfo(ArgumentSections.String),
new ArgumentInfo(ArgumentSections.String, true),
new ArgumentInfo(ArgumentSections.RealNumber, true),
new ArgumentInfo(ArgumentSections.RealNumber, true)),
};
}
@@ -97,8 +143,8 @@ namespace AcadToSMath
double scale = 1;
int isClose = 0;
if (TermsConverter.DecodeText(value.Items[0].Text).Trim('"') != "#") lay = TermsConverter.DecodeText(value.Items[0].Text).Trim('"');
if(TermsConverter.DecodeText(value.Items[1].Text).Trim('"')!="#") scale = Utilites.Entry2Double(value.Items[1], context);
if(TermsConverter.DecodeText(value.Items[2].Text).Trim('"')!="#") isClose = Utilites.Entry2Int(value.Items[2], context);
if (TermsConverter.DecodeText(value.Items[1].Text).Trim('"') != "#") scale = Utilites.Entry2Double(value.Items[1], context);
if (TermsConverter.DecodeText(value.Items[2].Text).Trim('"') != "#") isClose = Utilites.Entry2Int(value.Items[2], context);
const string progID = "AutoCAD.Application";
@@ -125,9 +171,6 @@ namespace AcadToSMath
{
ms = acApp.ActiveDocument.ModelSpace;
List<AcadLWPolyline> polylines = new List<AcadLWPolyline>();
List<AcadPoint> points = new List<AcadPoint>();
List<AcadCircle> circles = new List<AcadCircle>();
List<AcadText> textes = new List<AcadText>();
if (lay == "#")
{
for (int i = 0; i < ms.Count; i++)
@@ -142,7 +185,7 @@ namespace AcadToSMath
if (ms.Item(i).ObjectName == "AcDbPolyline" && ms.Item(i).Layer == lay) polylines.Add(ms.Item(i) as AcadLWPolyline);
}
}
if (polylines.Count==0)
if (polylines.Count == 0)
{
answer.AddRange(TermsConverter.ToTerms("\"Документ не содержит ни одной полилинии на заданном слое\""));
result = Entry.Create(answer.ToArray());
@@ -155,14 +198,14 @@ namespace AcadToSMath
{
AcadLWPolyline pline = polylines[i];
double[] crds = (double[])polylines[i].Coordinates;
int crdsc = crds.Length/2;
int crdsc = crds.Length / 2;
//List<double[]> crd = new List<double[]>(crdsc);
foreach (double item in crds) answer.AddRange(new TNumber(item*scale).obj.ToTerms());
foreach (double item in crds) answer.AddRange(new TNumber(item * scale).obj.ToTerms());
if (isClose == 1)
{
answer.AddRange(new TNumber(crds[0] * scale).obj.ToTerms());
answer.AddRange(new TNumber(crds[1] * scale).obj.ToTerms());
answer.AddRange(TermsConverter.ToTerms((crdsc+1).ToString()));
answer.AddRange(TermsConverter.ToTerms((crdsc + 1).ToString()));
answer.AddRange(TermsConverter.ToTerms(2.ToString()));
answer.Add(new Term(Functions.Mat, TermType.Function, 4 + crdsc * 2));
}
@@ -174,7 +217,7 @@ namespace AcadToSMath
}
}
if (plc >1)
if (plc > 1)
{
answer.AddRange(TermsConverter.ToTerms(1.ToString()));
answer.AddRange(TermsConverter.ToTerms(plc.ToString()));
@@ -257,7 +300,7 @@ namespace AcadToSMath
for (int i = 0; i < cc; i++)
{
AcadCircle c = circles[i];
double[]cen= (double[])c.Center;
double[] cen = (double[])c.Center;
answer.AddRange(new TNumber(cen[0] * scale).obj.ToTerms());
answer.AddRange(new TNumber(cen[1] * scale).obj.ToTerms());
answer.AddRange(new TNumber(c.Area * scale * scale).obj.ToTerms());
@@ -342,7 +385,7 @@ namespace AcadToSMath
for (int i = 0; i < pc; i++)
{
AcadPoint p = points[i];
double[]cen= (double[])p.Coordinates;
double[] cen = (double[])p.Coordinates;
answer.AddRange(new TNumber(cen[0] * scale).obj.ToTerms());
answer.AddRange(new TNumber(cen[1] * scale).obj.ToTerms());
answer.AddRange(new TNumber(cen[2] * scale).obj.ToTerms());
@@ -426,7 +469,7 @@ namespace AcadToSMath
for (int i = 0; i < pc; i++)
{
AcadText p = points[i];
double[]cen= (double[])p.InsertionPoint;
double[] cen = (double[])p.InsertionPoint;
answer.AddRange(new TNumber(cen[0] * scale).obj.ToTerms());
answer.AddRange(new TNumber(cen[1] * scale).obj.ToTerms());
answer.AddRange(TermsConverter.ToTerms("\"" + p.TextString + "\""));
@@ -510,8 +553,8 @@ namespace AcadToSMath
for (int i = 0; i < pc; i++)
{
AcadLine p = points[i];
double[]sp= (double[])p.StartPoint;
double[]ep= (double[])p.EndPoint;
double[] sp = (double[])p.StartPoint;
double[] ep = (double[])p.EndPoint;
double len = p.Length;
answer.AddRange(new TNumber(sp[0] * scale).obj.ToTerms());
answer.AddRange(new TNumber(sp[1] * scale).obj.ToTerms());
@@ -537,10 +580,330 @@ namespace AcadToSMath
}
}
//GetDxfLines
if (value.Type == TermType.Function && value.Text == "GetDxfLines")
{
List<Term> answer = new List<Term>();
Entry arg1 = Computation.Preprocessing(value.Items[0], context);
string filepath = TermsConverter.DecodeText(arg1.Text).Trim('"');
int indexOfChar = filepath.IndexOf(':');
if (indexOfChar == -1) filepath = Utilites.CurrentPath(context.FileName) + "\\" + filepath;
DxfDocument dxf = DxfDocument.Load(filepath);
string lay = "#";
double scale = 1;
if (TermsConverter.DecodeText(value.Items[1].Text).Trim('"') != "#") lay = TermsConverter.DecodeText(value.Items[1].Text).Trim('"');
if (TermsConverter.DecodeText(value.Items[2].Text).Trim('"') != "#") scale = Utilites.Entry2Double(value.Items[2], context);
if (dxf.Lines.Count() == 0)
{
answer.AddRange(TermsConverter.ToTerms("\"Документ не содержит ни одного отрезка на заданном слое\""));
result = Entry.Create(answer.ToArray());
return true;
}
else
{
List<Line> lines = new List<Line>();
foreach (Line item in dxf.Lines)
{
if (lay != "#" && item.Layer.Name == lay) lines.Add(item);
else if (lay == "#") lines.Add(item);
else continue;
}
if (lines.Count == 0)
{
answer.AddRange(TermsConverter.ToTerms("\"Документ не содержит ни одного отрезка на заданном слое\""));
result = Entry.Create(answer.ToArray());
return true;
}
else
{
foreach (Line item in lines)
{
answer.AddRange(new TNumber(item.StartPoint.X * scale).obj.ToTerms());
answer.AddRange(new TNumber(item.StartPoint.Y * scale).obj.ToTerms());
answer.AddRange(new TNumber(item.EndPoint.X * scale).obj.ToTerms());
answer.AddRange(new TNumber(item.EndPoint.Y * scale).obj.ToTerms());
answer.AddRange(new TNumber(Math.Sqrt(Math.Pow(item.EndPoint.X - item.StartPoint.X, 2) +
Math.Pow(item.EndPoint.Y - item.StartPoint.Y, 2)) * scale).obj.ToTerms());
}
answer.AddRange(TermsConverter.ToTerms(lines.Count.ToString()));
answer.AddRange(TermsConverter.ToTerms(5.ToString()));
answer.Add(new Term(Functions.Mat, TermType.Function, 2 + lines.Count * 5));
result = Entry.Create(answer.ToArray());
return true;
}
}
}
//GetDxfPoints
if (value.Type == TermType.Function && value.Text == "GetDxfPoints")
{
List<Term> answer = new List<Term>();
Entry arg1 = Computation.Preprocessing(value.Items[0], context);
string filepath = TermsConverter.DecodeText(arg1.Text).Trim('"');
int indexOfChar = filepath.IndexOf(':');
if (indexOfChar == -1) filepath = Utilites.CurrentPath(context.FileName) + "\\" + filepath;
DxfDocument dxf = DxfDocument.Load(filepath);
string lay = "#";
double scale = 1;
if (TermsConverter.DecodeText(value.Items[1].Text).Trim('"') != "#") lay = TermsConverter.DecodeText(value.Items[1].Text).Trim('"');
if (TermsConverter.DecodeText(value.Items[2].Text).Trim('"') != "#") scale = Utilites.Entry2Double(value.Items[2], context);
if (dxf.Lines.Count() == 0)
{
answer.AddRange(TermsConverter.ToTerms("\"Документ не содержит ни одного отрезка на заданном слое\""));
result = Entry.Create(answer.ToArray());
return true;
}
else
{
List<Point> lines = new List<Point>();
foreach (Point item in dxf.Points)
{
if (lay != "#" && item.Layer.Name == lay) lines.Add(item);
else if (lay == "#") lines.Add(item);
else continue;
}
if (lines.Count == 0)
{
answer.AddRange(TermsConverter.ToTerms("\"Документ не содержит ни одного отрезка на заданном слое\""));
result = Entry.Create(answer.ToArray());
return true;
}
else
{
foreach (Point item in lines)
{
answer.AddRange(new TNumber(item.Position.X * scale).obj.ToTerms());
answer.AddRange(new TNumber(item.Position.Y * scale).obj.ToTerms());
answer.AddRange(new TNumber(item.Position.Z * scale).obj.ToTerms());
}
answer.AddRange(TermsConverter.ToTerms(lines.Count.ToString()));
answer.AddRange(TermsConverter.ToTerms(3.ToString()));
answer.Add(new Term(Functions.Mat, TermType.Function, 2 + lines.Count * 3));
result = Entry.Create(answer.ToArray());
return true;
}
}
}
//GetDxfTextes
if (value.Type == TermType.Function && value.Text == "GetDxfTextes")
{
List<Term> answer = new List<Term>();
Entry arg1 = Computation.Preprocessing(value.Items[0], context);
string filepath = TermsConverter.DecodeText(arg1.Text).Trim('"');
int indexOfChar = filepath.IndexOf(':');
if (indexOfChar == -1) filepath = Utilites.CurrentPath(context.FileName) + "\\" + filepath;
DxfDocument dxf = DxfDocument.Load(filepath);
string lay = "#";
double scale = 1;
if (TermsConverter.DecodeText(value.Items[1].Text).Trim('"') != "#") lay = TermsConverter.DecodeText(value.Items[1].Text).Trim('"');
if (TermsConverter.DecodeText(value.Items[2].Text).Trim('"') != "#") scale = Utilites.Entry2Double(value.Items[2], context);
if (dxf.Lines.Count() == 0)
{
answer.AddRange(TermsConverter.ToTerms("\"Документ не содержит ни одного отрезка на заданном слое\""));
result = Entry.Create(answer.ToArray());
return true;
}
else
{
List<Text> lines = new List<Text>();
foreach (Text item in dxf.Texts)
{
if (lay != "#" && item.Layer.Name == lay) lines.Add(item);
else if (lay == "#") lines.Add(item);
else continue;
}
if (lines.Count == 0)
{
answer.AddRange(TermsConverter.ToTerms("\"Документ не содержит ни одного отрезка на заданном слое\""));
result = Entry.Create(answer.ToArray());
return true;
}
else
{
foreach (Text item in lines)
{
answer.AddRange(new TNumber(item.Position.X * scale).obj.ToTerms());
answer.AddRange(new TNumber(item.Position.Y * scale).obj.ToTerms());
answer.AddRange(TermsConverter.ToTerms("\"" + item.Value + "\""));
}
answer.AddRange(TermsConverter.ToTerms(lines.Count.ToString()));
answer.AddRange(TermsConverter.ToTerms(3.ToString()));
answer.Add(new Term(Functions.Mat, TermType.Function, 2 + lines.Count * 3));
result = Entry.Create(answer.ToArray());
return true;
}
}
}
//GetDxfCircles
if (value.Type == TermType.Function && value.Text == "GetDxfCircles")
{
List<Term> answer = new List<Term>();
Entry arg1 = Computation.Preprocessing(value.Items[0], context);
string filepath = TermsConverter.DecodeText(arg1.Text).Trim('"');
int indexOfChar = filepath.IndexOf(':');
if (indexOfChar == -1) filepath = Utilites.CurrentPath(context.FileName) + "\\" + filepath;
DxfDocument dxf = DxfDocument.Load(filepath);
string lay = "#";
double scale = 1;
if (TermsConverter.DecodeText(value.Items[1].Text).Trim('"') != "#") lay = TermsConverter.DecodeText(value.Items[1].Text).Trim('"');
if (TermsConverter.DecodeText(value.Items[2].Text).Trim('"') != "#") scale = Utilites.Entry2Double(value.Items[2], context);
if (dxf.Lines.Count() == 0)
{
answer.AddRange(TermsConverter.ToTerms("\"Документ не содержит ни одного отрезка на заданном слое\""));
result = Entry.Create(answer.ToArray());
return true;
}
else
{
List<Text> lines = new List<Text>();
foreach (Text item in dxf.Texts)
{
if (lay != "#" && item.Layer.Name == lay) lines.Add(item);
else if (lay == "#") lines.Add(item);
else continue;
}
if (lines.Count == 0)
{
answer.AddRange(TermsConverter.ToTerms("\"Документ не содержит ни одного отрезка на заданном слое\""));
result = Entry.Create(answer.ToArray());
return true;
}
else
{
foreach (Text item in lines)
{
answer.AddRange(new TNumber(item.Position.X * scale).obj.ToTerms());
answer.AddRange(new TNumber(item.Position.Y * scale).obj.ToTerms());
answer.AddRange(TermsConverter.ToTerms("\"" + item.Value + "\""));
}
answer.AddRange(TermsConverter.ToTerms(lines.Count.ToString()));
answer.AddRange(TermsConverter.ToTerms(3.ToString()));
answer.Add(new Term(Functions.Mat, TermType.Function, 2 + lines.Count * 3));
result = Entry.Create(answer.ToArray());
return true;
}
}
}
//GetDxfPlines
if (value.Type == TermType.Function && value.Text == "GetDxfPlines")
{
List<Term> answer = new List<Term>();
Entry arg1 = Computation.Preprocessing(value.Items[0], context);
string filepath = TermsConverter.DecodeText(arg1.Text).Trim('"');
int indexOfChar = filepath.IndexOf(':');
if (indexOfChar == -1) filepath = Utilites.CurrentPath(context.FileName) + "\\" + filepath;
DxfDocument dxf = DxfDocument.Load(filepath);
string lay = "#";
double scale = 1;
int isClose = 0;
if (TermsConverter.DecodeText(value.Items[1].Text).Trim('"') != "#")
{
Entry arg = Computation.Preprocessing(value.Items[1], context);
lay = TermsConverter.DecodeText(arg.Text).Trim('"');
}
if (TermsConverter.DecodeText(value.Items[2].Text).Trim('"') != "#") scale = Utilites.Entry2Double(value.Items[2], context);
if (TermsConverter.DecodeText(value.Items[3].Text).Trim('"') != "#") isClose = Utilites.Entry2Int(value.Items[3], context);
if (dxf.Lines.Count() == 0)
{
answer.AddRange(TermsConverter.ToTerms("\"Документ не содержит ни одной полилинии на заданном слое\""));
result = Entry.Create(answer.ToArray());
return true;
}
else
{
List<LwPolyline> lines = new List<LwPolyline>();
foreach (LwPolyline item in dxf.LwPolylines)
{
if (lay != "#" && item.Layer.Name == lay) lines.Add(item);
else if (lay == "#") lines.Add(item);
else continue;
}
if (lines.Count == 0)
{
answer.AddRange(TermsConverter.ToTerms("\"Документ не содержит ни одной полилинии на заданном слое\""));
result = Entry.Create(answer.ToArray());
return true;
}
else if(lines.Count == 1)
{
LwPolyline item = lines[0];
List<LwPolylineVertex> vxs = item.Vertexes;
foreach (LwPolylineVertex vx in vxs)
{
answer.AddRange(new TNumber(vx.Position.X * scale).obj.ToTerms());
answer.AddRange(new TNumber(vx.Position.Y * scale).obj.ToTerms());
}
if (isClose != 0)
{
answer.AddRange(new TNumber(vxs[0].Position.X * scale).obj.ToTerms());
answer.AddRange(new TNumber(vxs[0].Position.Y * scale).obj.ToTerms());
answer.AddRange(TermsConverter.ToTerms((vxs.Count + 1).ToString()));
answer.AddRange(TermsConverter.ToTerms(2.ToString()));
answer.Add(new Term(Functions.Mat, TermType.Function, 4 + vxs.Count * 2));
result = Entry.Create(answer.ToArray());
return true;
}
answer.AddRange(TermsConverter.ToTerms(vxs.Count.ToString()));
answer.AddRange(TermsConverter.ToTerms(2.ToString()));
answer.Add(new Term(Functions.Mat, TermType.Function, 2 + vxs.Count * 2));
result = Entry.Create(answer.ToArray());
return true;
}
else
{
foreach (LwPolyline item in lines)
{
List<LwPolylineVertex> vxs = item.Vertexes;
foreach (LwPolylineVertex vx in vxs)
{
answer.AddRange(new TNumber(vx.Position.X * scale).obj.ToTerms());
answer.AddRange(new TNumber(vx.Position.Y * scale).obj.ToTerms());
}
if (isClose != 0)
{
answer.AddRange(new TNumber(vxs[0].Position.X * scale).obj.ToTerms());
answer.AddRange(new TNumber(vxs[0].Position.Y * scale).obj.ToTerms());
answer.AddRange(TermsConverter.ToTerms((vxs.Count + 1).ToString()));
answer.AddRange(TermsConverter.ToTerms(2.ToString()));
answer.Add(new Term(Functions.Mat, TermType.Function, 4 + vxs.Count * 2));
}
else
{
answer.AddRange(TermsConverter.ToTerms(vxs.Count.ToString()));
answer.AddRange(TermsConverter.ToTerms(2.ToString()));
answer.Add(new Term(Functions.Mat, TermType.Function, 2 + vxs.Count * 2));
}
}
answer.AddRange(TermsConverter.ToTerms(1.ToString()));
answer.AddRange(TermsConverter.ToTerms(lines.Count.ToString()));
answer.Add(new Term(Functions.Mat, TermType.Function, 2 + lines.Count));
result = Entry.Create(answer.ToArray());
return true;
}
}
}
result = null;
return false;
}
}
}

View File

@@ -40,16 +40,19 @@
<SMathDir Condition=" '$(SMathDir)' == '' ">C:\Program Files (x86)\SMathStudio</SMathDir>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autodesk.AutoCAD.Interop">
<HintPath>..\..\..\..\..\..\Program Files\Autodesk\AutoCAD 2020\Autodesk.AutoCAD.Interop.dll</HintPath>
<Reference Include="Autodesk.AutoCAD.Interop, Version=23.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>False</EmbedInteropTypes>
<HintPath>bin\Debug\Autodesk.AutoCAD.Interop.dll</HintPath>
</Reference>
<Reference Include="Autodesk.AutoCAD.Interop.Common">
<HintPath>..\..\..\..\..\..\Program Files\Autodesk\AutoCAD 2020\Autodesk.AutoCAD.Interop.Common.dll</HintPath>
<Reference Include="Autodesk.AutoCAD.Interop.Common, Version=23.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>False</EmbedInteropTypes>
<HintPath>bin\Debug\Autodesk.AutoCAD.Interop.Common.dll</HintPath>
</Reference>
<Reference Include="netDxf">
<HintPath>..\..\..\Документы\C#\netDxf.dll</HintPath>
<Reference Include="netDxf, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\netDxf.dll</HintPath>
</Reference>
<Reference Include="SMath.Controls">
<HintPath>..\..\..\..\..\..\Program Files (x86)\SMath Studio\SMath.Controls.dll</HintPath>

View File

@@ -5,6 +5,8 @@ using System;
using System.Collections.Generic;
using SMath.Math;
using System.IO;
using System.Runtime.Remoting.Contexts;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
namespace AcadToSMath
{
@@ -46,7 +48,8 @@ namespace AcadToSMath
internal static double[] EntryVec2Arr(Entry vector, Store store)
{
TNumber num = Computation.NumericCalculation(vector, store);
Entry arg = Computation.Preprocessing(vector, store);
TNumber num = Computation.NumericCalculation(arg, store);
TMatrix matrix = (TMatrix)num.obj;
double[] res = new double[matrix.Length()];
//for (int i = 0; i < matrix.unit.Length; i++)
@@ -71,7 +74,8 @@ namespace AcadToSMath
internal static double[,] EntryMat2Arr(Entry mat, Store store)
{
TNumber num = Computation.NumericCalculation(mat, store);
Entry arg = Computation.Preprocessing(mat, store);
TNumber num = Computation.NumericCalculation(arg, store);
TMatrix matrix = (TMatrix)num.obj;
double[,] res = new double[matrix.unit.GetLength(0), matrix.unit.GetLength(1)];
for (int i = 0; i < matrix.unit.GetLength(0); i++)
@@ -86,13 +90,15 @@ namespace AcadToSMath
internal static double Entry2Double(Entry prime, Store store)
{
TNumber num = Computation.NumericCalculation(prime, store);
Entry arg = Computation.Preprocessing(prime, store);
TNumber num = Computation.NumericCalculation(arg, store);
return num.obj.ToDouble();
}
internal static int Entry2Int(Entry prime, Store store)
{
TNumber num = Computation.NumericCalculation(prime, store);
Entry arg = Computation.Preprocessing(prime, store);
TNumber num = Computation.NumericCalculation(arg, store);
return (int)num.obj.ToDouble();
}