标注生成时有时文字位置会与正常的位置相反..
自动生成标注为什么会突然的出现文字位置相反的情况....请问怎么解决
public static AlignedDimension CreatLineDimension(Line line, LinePosition pos, int level)
{
double dimTextHeight = HostApplicationServices.WorkingDatabase.Dimtxt;
double dimTextFloat = HostApplicationServices.WorkingDatabase.Dimgap;
Vector3d vt = new Vector3d();
switch (pos){
case LinePosition.hTop:
vt = new Vector3d(0, ((3 * dimTextFloat) + (dimTextHeight + 2 * dimTextFloat) * (level - 1)), 0);break;
case LinePosition.hBot:
vt = new Vector3d(0, -(2 * dimTextFloat + dimTextHeight) * level, 0); break;
case LinePosition.vLeft:
vt = new Vector3d(-((3 * dimTextFloat) + (dimTextHeight + 2 * dimTextFloat) * (level - 1)), 0, 0); break;
case LinePosition.vRight:
vt = new Vector3d((2 * dimTextFloat + dimTextHeight) * level, 0, 0); break;
}
Point3d linePoint = GeTool.MidPoint(line.StartPoint, line.EndPoint).Add(vt);
Database db = HostApplicationServices.WorkingDatabase;
AlignedDimension dimAligned = new AlignedDimension();
dimAligned.DimensionStyle = db.Dimstyle;
dimAligned.XLine1Point = line.StartPoint;
dimAligned.XLine2Point = line.EndPoint;
dimAligned.DimLinePoint = linePoint;
dimAligned.Dimtix = true;
return dimAligned;
}
页:
[1]