翻譯|使用教程|編輯:李顯亮|2021-04-08 10:06:25.387|閱讀 188 次
概述:本系列教程整理了VectorDraw Developer Framework(VDF)最常見問題,教程整理的很齊全,非常適合新手學(xué)習(xí)。本文將會介紹單擊如何創(chuàng)建旋轉(zhuǎn)尺寸。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
VectorDraw Developer Framework(VDF)是一個用于應(yīng)用程序可視化的圖形引擎庫。有了VDF提供的功能,您可以輕松地創(chuàng)建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。該庫還支持許多矢量和柵格輸入和輸出格式,包括本地PDF和SVG導(dǎo)出。
點(diǎn)擊下載VectorDraw Developer Framework
問:單擊是否可以創(chuàng)建旋轉(zhuǎn)的連續(xù)尺寸?
您可以嘗試如下代碼:
gPoint prevPT = null; // the point that th euser clicked previously gPoint DimPos = null; // position of the dimensions bool IsOnDimCont = false; private void button1_Click(object sender, EventArgs e) { //where doc is a vdDocument, like vdFramedControl1.BaseControl.ActiveDocument IsOnDimCont = false; if (doc.CommandAction.CmdDim(VectorDraw.Professional.Constants.VdConstDimType.dim_Rotated, null, null, 0.0d)) { vdDimension dim = doc.ActiveLayOut.Entities.Last as vdDimension; prevPT = doc.World2UserMatrix.Transform(new gPoint(dim.DefPoint2)); // get the last point the user clicked and keep it for the next dimension gPoint DimPos = doc.World2UserMatrix.Transform(new gPoint(dim.LinePosition)); // or you can calculate this by using the midpoint of DefPoint1 & DefPoint2 plus a DX/DY doc.OnPrompt += new vdDocument.PromptEventHandler(doc_OnPrompt);// enable the event for (int i = 0; i < 5; i++) // here you can change it to a do..while loop { IsOnDimCont = true; if (doc.CommandAction.CmdDim(VectorDraw.Professional.Constants.VdConstDimType.dim_Rotated, null, DimPos, 0.0d)) { vdDimension dimNext = doc.ActiveLayOut.Entities.Last as vdDimension; prevPT = doc.World2UserMatrix.Transform(new gPoint(dimNext.DefPoint2)); // get the last point the user clicked and keep it for the next dimension } IsOnDimCont = false; } doc.OnPrompt -= new vdDocument.PromptEventHandler(doc_OnContDimPrompt); // disable it } } void doc_OnContDimPrompt(object sender, ref string promptstr) { if (IsOnDimCont && sender!=null && promptstr == "First Point:" ) // this means that it is inside your cont. dimension code { doc.PostCommandActionString(vdFramedControl1.BaseControl, prevPT.ToString()); // here we pass the first point of the new dimension using the prevPT stored earlier } }
=======================================================
如果您對想要購買正版授權(quán)VectorDraw Developer Framework(VDF),可以聯(lián)系咨詢相關(guān)問題。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn