Skip to content

Commit

Permalink
Update ExtractLocation.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed Apr 11, 2023
1 parent 6bda873 commit 04c8324
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions Test/ExtractLocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public void GetAllXrefBlock()
tr.Commit();
}

// string filepath = @"D:/test.csv";
// ExportToCsv(assignmentDatas, filepath, true, ",");
// Process.Start(filepath);
string filepath = @"D:/test.csv";
ExportToCsv(assignmentDatas, filepath, true, ",");
Process.Start(filepath);
}

void TestTransform()
Expand Down Expand Up @@ -147,27 +147,25 @@ public void GetInfoRecord(BlockReference blockReference, ref List<AssignmentData
{
// Get position of block reference
Point3d position = blockReference.Position;
Matrix3d inverse = blockReference.BlockTransform.Inverse();
var total = wcs * inverse;
curPt = position.TransformBy(total);
curPt = position.TransformBy(wcs);
//create stepPt to calc translate position
stepPt = attRef.Position.TransformBy(wcs);
// curPt add stepPt
curPt = curPt.Add(stepPt.GetAsVector());
// rotate block
// rotate
// Matrix3d rotation = Matrix3d.Rotation(blockReference.Rotation, Vector3d.ZAxis, blockReference.Position);
// curPt = curPt.TransformBy(rotation);
datas.Add(new AssignmentData()
{
Name = attRef.TextString,
X = curPt.X.ToString(CultureInfo.InvariantCulture),
Y = curPt.Y.ToString(CultureInfo.InvariantCulture)
});
string textCheck = "F10A2-2-F43V-He-E43-64";
// string textCheck2 = "F10A2-2-F39V-He-E39-63(PT)";
string textCheck2 = "F10A2-2-F39V-He-E39-63(PT)";
if (attRef.TextString == textCheck)
{
MessageBox.Show(curPt.ToString());

// Trace.WriteLine("LPOC Name: " + attRef.TextString);
// Trace.WriteLine($"LPOC Position: " + lopcPosition);
}
}

Expand Down

0 comments on commit 04c8324

Please sign in to comment.