CAD add a tangible line (web version)

The main use of Function:


_DMxDrawX::AddTextStyle1


Add a text style to the database. Details are as follows:


parameter Explanation

BSTR pszName

Text style name

BSTR pszFileName

shx file name

BSTR pszBigFontFileName

big shx file name

DOUBLE dXScale

Text width scaling


_DMxDrawX::AddLinetypeEx


A linear increase in complexity with text. Details are as follows:


parameter Explanation

BSTR pszName

Linear name

BSTR pszLineDefine

Linear definition string

BSTR pszTextStyle

Linear text style


Js code embodied as follows:


1
2
3
4
5
6
7
8
9
10
11
12
13
function CreateLineType2() {
     //增加一个带有形的线型
     mxOcx.AddTextStyle1( "MyLineTypeTextStyle" , "txt.shx" , "hztxt.shx" , 1);
     var linetypeId= mxOcx.AddLinetypeEx ( "MyLineType2" , "(12.7,(\"T=MxDraw\",\"S=2.54\",\"L=-5.08\",\"R=0.0\"," +
         "\"X=-2.54\",\"Y=-1.27\"),-10.08)" , "MyLineTypeTextStyle" );
     //返回控件的数据库对象
     var database = mxOcx.GetDatabase();
     //实体id返回实体对象
     var linetype = database.ObjectIdToObject(linetypeId);
     //设计当前线型为"MyLineType2"
     database.CurrentlyLineTypeName  = "MyLineType2" ;
     alert( "添加成功" );
}

Guess you like

Origin www.cnblogs.com/yzy0224/p/10979355.html