添加项目文件。
This commit is contained in:
66
HYDragCurveJigPro/JigTextInfo.cs
Normal file
66
HYDragCurveJigPro/JigTextInfo.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
using System;
|
||||
|
||||
namespace HYDragCurveJig
|
||||
{
|
||||
public class JigTextInfo
|
||||
{
|
||||
public TextNoteType theTextNoteType { get; set; }
|
||||
|
||||
public XYZ Origin { get; set; }
|
||||
|
||||
public XYZ BaseVec { get; set; }
|
||||
|
||||
public XYZ UpVec { get; set; }
|
||||
|
||||
public double LineWidth { get; set; }
|
||||
|
||||
public TextAlignFlags TextAlign { get; set; }
|
||||
|
||||
public string StrText { get; set; }
|
||||
|
||||
public JigTextInfo(JigTextInfo rhs)
|
||||
{
|
||||
this.theTextNoteType = rhs.theTextNoteType;
|
||||
this.Origin = rhs.Origin;
|
||||
this.BaseVec = rhs.BaseVec;
|
||||
this.UpVec = rhs.UpVec;
|
||||
this.TextAlign = rhs.TextAlign;
|
||||
this.LineWidth = rhs.LineWidth;
|
||||
this.StrText = rhs.StrText;
|
||||
}
|
||||
|
||||
public JigTextInfo(TextNoteType textNoteType, XYZ origin, XYZ baseVec, XYZ upVec, TextAlignFlags textAlign, double lineWidth, string strText)
|
||||
{
|
||||
this.theTextNoteType = textNoteType;
|
||||
this.Origin = origin;
|
||||
this.BaseVec = baseVec;
|
||||
this.UpVec = upVec;
|
||||
this.TextAlign = textAlign;
|
||||
this.LineWidth = lineWidth;
|
||||
this.StrText = strText;
|
||||
}
|
||||
|
||||
public JigTextInfo TransformTo(Transform matrix, bool transformCoordinateSystem = false)
|
||||
{
|
||||
XYZ xyz = JigGeometry.TransformPoint(this.Origin, matrix);
|
||||
if (transformCoordinateSystem)
|
||||
{
|
||||
this.BaseVec = JigGeometry.TransformPoint(this.BaseVec, matrix);
|
||||
this.UpVec = JigGeometry.TransformPoint(this.UpVec, matrix);
|
||||
}
|
||||
return new JigTextInfo(this.theTextNoteType, xyz, this.BaseVec, this.UpVec, this.TextAlign, this.LineWidth, this.StrText);
|
||||
}
|
||||
|
||||
public void TransformSelf(Transform matrix, bool transformCoordinateSystem = false)
|
||||
{
|
||||
this.Origin = JigGeometry.TransformPoint(this.Origin, matrix);
|
||||
if (transformCoordinateSystem)
|
||||
{
|
||||
this.BaseVec = JigGeometry.TransformPoint(this.BaseVec, matrix);
|
||||
this.UpVec = JigGeometry.TransformPoint(this.UpVec, matrix);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user