本文整理汇总了C#中ModelDoc2.AddVerticalDimension2方法的典型用法代码示例。如果您正苦于以下问题:C# ModelDoc2.AddVerticalDimension2方法的具体用法?C# ModelDoc2.AddVerticalDimension2怎么用?C# ModelDoc2.AddVerticalDimension2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelDoc2
的用法示例。
在下文中一共展示了ModelDoc2.AddVerticalDimension2方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDimensionLineDirect
public double[] GetDimensionLineDirect(ModelDoc2 swModel, double[] boundBox, bool vertic,BlockPosition side, out double d, out Annotation annotation,out bool? blockSize,out Ordinate vertex,out Ordinate vertexS, double[] dsDim,double[] deDim,double[] endDim,string dsName,string deName)
{
blockSize = null;
var swDrawing = (DrawingDoc) swModel;
var drView = swDrawing.IActiveDrawingView;
var scale = (double[]) drView.ScaleRatio;
double vScaleRat = scale[1];
double[] doubles = null;
d = 0;
annotation = null;
vertex = GetVertexFromBlock(swModel, drView, vScaleRat,true);
if(!(vertex!=null && SelectVertexDatum(swModel, vertex)))
vertex = SelectVertexDatumUp(swModel, boundBox, side);
if (dsDim != null && deDim != null)
{
vertexS = GetVertexFromBlock(swModel, drView, vScaleRat, false);
//swModel.ClearSelection2(true);
swDrawing.ActivateView(drView.Name);
bool tmp = swModel.Extension.SelectByID2(@"Точка вставки/" + dsName, "SKETCHPOINT", 0, 0, 0, false, 0, null, 0);
tmp = swModel.Extension.SelectByID2(@"Точка вставки/" + deName, "SKETCHPOINT", 0, 0, 0, true, 0, null, 0);
DisplayDimension dim1;
if (vertic)
dim1 = swModel.AddVerticalDimension2(0, 0, 0);
else
dim1 = swModel.AddHorizontalDimension2(0, 0, 0);
dim1.GetDimension().DrivenState = (int)swDimensionDrivenState_e.swDimensionDriven;
d = dim1.GetDimension().Value;
if (vertic)
{
doubles = new double[3] { 1, 0, 0 };
}
else
{
doubles = new double[3] {0, 1, 0};
}
annotation = dim1.GetAnnotation();
}
else
{
if (vertic)
{
vertexS = GetVertexFromBlock(swModel, drView, vScaleRat, false);
if (!(vertexS != null && SelectVertexDatum(swModel, vertexS)))
SelectVertexDatumDown(swModel, boundBox, side);
else if (vertex != null)
blockSize = vertex.X < vertexS.X;
DisplayDimension dim = null;
dim = swModel.IAddVerticalDimension2(0, 0, 0);
if (dim != null)
{
d = dim.IGetDimension().Value;
doubles = (double[]) dim.IGetDimension().DimensionLineDirection.ArrayData;
if (blockSize != null)
{
vertexS.Y = vertexS.Y + (d/1000)/vScaleRat;
}
annotation = dim.IGetAnnotation();
}
}
else
{
vertexS = GetVertexFromBlock(swModel, drView, vScaleRat, false);
if (!(vertexS != null && SelectVertexDatum(swModel, vertexS)))
{
vertexS = SelectVertexDatumUp(swModel, boundBox, side.Not());
}
else if (vertex != null)
blockSize = vertex.X < vertexS.X;
var dim = swModel.AddHorizontalDimension2(0, 0, 0);
if (dim != null)
{
d = dim.GetDimension().Value;
doubles = (double[]) dim.GetDimension().DimensionLineDirection.ArrayData;
annotation = dim.GetAnnotation();
}
}
}
swModel.ClearSelection();
return doubles;
}