yanchengPowerSupply/node_modules/mxdraw/dist/lib/MxModule/MxDbRectBoxLeadComment/draw.js

1 line
1.2 KiB
JavaScript

import MxDbRectBoxLeadComment from".";import McEdGetPointWorldDrawObject from"../McEdGetPointWorldDrawObject";import MrxDbgUiPrBaseReturn from"../MrxDbgUiPrBaseReturn";import MrxDbgUiPrPoint from"../MrxDbgUiPrPoint";import MxFun from"../MxFun";export default function drawMxDbRectBoxLeadComment(){const t=new MrxDbgUiPrPoint,e=MxFun.getCurrentDraw(),r=new McEdGetPointWorldDrawObject,o=new MxDbRectBoxLeadComment;o.setLineWidth(3),o.setLineWidthByPixels(!0),t.setMessage("\n云线框起始点:"),t.go(n=>{o.radius=MxFun.screenCoordLong2Doc(8),n==MrxDbgUiPrBaseReturn.kOk&&(o.point1=t.value(),r.setDraw(t=>{o.point2=t,r.drawCustomEntity(o)}),t.setUserDraw(r),t.setMessage("\n云线框结束点:"),t.go(n=>{if(n!=MrxDbgUiPrBaseReturn.kOk)return;o.point2=t.value(),r.setDraw(t=>{o.point3=t,r.drawCustomEntity(o)});let i=prompt("请输入文字批注","批注");i||(i="默认批注文字"),o.text=i,o.textWidth=MxFun.screenCoordLong2Doc(10*i.length),o.textHeight=MxFun.screenCoordLong2Doc(5*i.length),o.fixedSize=!0,o.fixedSize&&(o.textHeight=20,o.textWidth=20*i.length),t.setMessage("\n审图标注点:"),t.go(r=>{r==MrxDbgUiPrBaseReturn.kOk&&(o.point3=t.value(),e.addMxEntity(o))})}))})};