www.mxdraw.com
内容索引主面
前一个向上下一个
_DMxDrawX::DrawDimRotated 方法

绘制一个线型标注

IDL
[id(101), helpstring("method DrawDimRotated")]
LONGLONG DrawDimRotated(DOUBLE dExtLine1PointX, DOUBLE dExtLine1PointY, DOUBLE dExtLine2PointX, DOUBLE dExtLine2PointY, DOUBLE dDimLineLocationX, DOUBLE dDimLineLocationY, DOUBLE dRotationAngle);
参数 
说明 
DOUBLE dExtLine1PointX 
输入第一条界线的起始点X值 
DOUBLE dExtLine1PointY 
输入第一条界线的起始点Y值 
DOUBLE dExtLine2PointX 
输入第二条界线的起始点X值 
DOUBLE dExtLine2PointY 
输入第二条界线的起始点Y值 
DOUBLE dDimLineLocationX 
输入标注线自身上的点X值 
DOUBLE dDimLineLocationY 
输入标注线自身上的点Y值 
DOUBLE dRotationAngle 
输入标注的旋转角 

返回新绘制的标注id

例如: VB代码

    Private Sub DrawDimRotated_Click()
    MxDrawX1.AddDimStyle "MyDimStyle4", "41,0.18,141,0.09,40,200", "77,1,271,3", "", ""
    MxDrawX1.DimStyle = "MyDimStyle4"

    '把颜色改回黑白色
    MxDrawX1.DrawColor = 0

    '把线型改成实线
    MxDrawX1.LineType = ""

    '设置线宽 4
    MxDrawX1.LineWidth = 0


    MxDrawX1.DrawDimRotated 0, 7000, 500, 7000, 250, 7050, 0

    MxDrawX1.DrawDimRotated 0, 7200, 0, 7400, 150, 7300, 0.771

    '把所有的实体都放到当前显示视区
    MxDrawX1.ZoomAll

    '更新视区显示
    MxDrawX1.UpdateDisplay
    End Sub

 

例如: 绘一个文字自动剧中的标注

            MxDrawDatabase MxDrawDatabase1 = (MxDrawDatabase)axMxDrawX1.GetDatabase();
            MxDrawDatabase1.LinetypeScale = 15;

            MxDrawDimStyleTableRecord curDimRecord = MxDrawDatabase1.GetDimStyleTable().GetAt(MxDrawDatabase1.CurrentlyDimstyleName, false);
            MxDrawTextStyleTableRecord curTextRecord = MxDrawDatabase1.GetTextStyleTable().GetAt(MxDrawDatabase1.CurrentlyTextStyle, false);
            curDimRecord.SetDimVarDouble(40, 1000);//设置缩放比例Dimscale
            curDimRecord.SetDimVarInt(271, 0);//设置两位小数DimDle
            curDimRecord.SetDimVarInt(173, 1);  //设置需要显示符号
            curDimRecord.SetDimVarInt(289, 3);
            curDimRecord.SetDimVarInt(174, 1);
            curDimRecord.SetDimVarString(342, "_ARCHTICK");    //设置建筑标记
            curTextRecord.bigFontFileName = "gbcbig.shx";
            curTextRecord.fileName = "tssdeng.shx";
            curTextRecord.Name = "默认样式";

            Int64 dimID = axMxDrawX1.DrawDimRotated(100, 100, 100, 200, 200, 150, 0);
            MxDrawDimension Dim = (MxDrawDimension)axMxDrawX1.ObjectIdToObject(dimID);
            Dim.DimensionText = "100";
            Dim.SetDimVarInt(173, 1);  //设置需要显示符号
            Dim.SetDimVarInt(289, 0);

            Dim.SetDimVarInt(174, 1);
            Dim.SetDimVarString(342, "_ARCHTICK");    //设置建筑标记

            MxDrawPoint textPos = new MxDrawPoint();
            textPos.x = 200;
            textPos.y = 150;
            Dim.TextPosition = textPos;
            Dim.UsingDefaultTextPosition = false;
            Dim.RecomputeDimBlock(true);
            axMxDrawX1.UpdateDisplay();
            axMxDrawX1.ZoomAll();
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!