function GetPolyline() { var ent = mxOcx.GetEntity( "选择pl线:" ); if (ent == null ) { return ; } if (ent.ObjectName != "McDbPolyline" ) { return ; } var param = mxOcx.NewResbuf(); param.AddObjectId(ent.ObjectID); var ret = mxOcx.CallEx( 'Mx_Explode' , param); var jj = 1; for (;jj < ret.Count;jj++) { var tmp = ret.AtObject(jj); if (tmp.ObjectName == "McDbLine" ) { // 是个直线。 得到直线的开始点坐标,和结束点坐标。 var spt = tmp.StartPoint; var ept = tmp.EndPoint; alert(spt.x); alert(spt.y); alert(ept.x); alert(ept.y); } else if (tmp.ObjectName == "McDbArc" ) { // 是个圆弧 var cen = tmp.Center; var sAng = tmp.StartAngle; var eAng = tmp.EndAngle; var r = tmp.Radius; alert(r); } tmp.Erase(); } } |
related question
• drawings inside How to print the page to add header and footer?
• How to add a text style, and set the current text style, etc.
• How to dynamically draw a straight line with a length of?
• how to select a set point in the structure?
• how dynamic draw polylines?
• How to dynamically draw the spline?
• how to draw a circle with a perimeter of the area?
• how dynamically draw a rectangle with a perimeter of the area?
• How to Draw a custom entity in the web page?
• Insert Block, how to set the bottom left of the starting point?