原創|使用教程|編輯:李顯亮|2020-08-28 10:19:47.403|閱讀 183 次
概述:本系列教程整理了VectorDraw Developer Framework(VDF)最常見問題,教程整理的很齊全,非常適合新手學習。本文將會介紹如何如何獲取外部參考文檔的實體和如何在不從vdAttribute對象格式化的情況下獲取字符串(值)。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
VectorDraw Developer Framework(VDF)是一個用于應用程序可視化的圖形引擎庫。有了VDF提供的功能,您可以輕松地創建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。該庫還支持許多矢量和柵格輸入和輸出格式,包括本地PDF和SVG導出。
點擊下載VectorDraw Developer Framework
問:如何獲得外部參考文件的實體?
答:請參考獲取外部參考文檔實體的示例
var blk = vdcanvas.AddBlockFromFile("test.vds", "myblock", false, _loadedDelegate); function _loadedDelegate(xrefargs) { var xrefdoc = xrefargs.documentdata.vdDocument; var block = xrefargs.Block; var entities = xrefdoc.Model.Entities.Items; var fig; for (var i = 0; i < entities.length; i++) { fig = xrefdoc[entities[i]]; } vdcanvas.scriptCommand.blockref("myblock", null); }
問:如何在不從vdAttribute對象格式化的情況下獲取字符串(值)?
答:可以借助vdMtext對象獲取屬性的純文本(值),例如:
private void button1_Click(object sender, EventArgs e) { vdDocument doc = vdFramedControl.BaseControl.ActiveDocument; doc.Open(@"C:\test\test.vdcl"); // the test drawing contains only an vdInsert with an attribute vdInsert ins = doc.Model.Entities[0] as vdInsert; // get the insert if (ins == null) return; vdAttrib atr = ins.Attributes[0] as vdAttrib; // get the attribute if (atr == null) return; vdMText mtxt = new vdMText(doc, atr.ValueString, new gPoint(), 1.0d); // define a new temporary vdMtext object with the attribute’s string VectorDraw.Generics.vdArray plaintext = mtxt.GetActualStringArray(); // get the PLAIN strings/value of the attribute mtxt = null; //vmMetxt is not needed any more! string messageboxstr = ""; foreach (string item in plaintext) { messageboxstr += item + "\r\n"; } MessageBox.Show(messageboxstr); // display the attribute’s value }以上問答,如果您有任何的疑惑都可以在評論區留言,我們會及時回復。此系列的問答教程我們會持續更新,如果您感興趣,可以多多關注本教程。
熱門文章推薦:
=======================================================
如果您對想要購買正版授權VectorDraw Developer Framework(VDF),可以聯系咨詢相關問題。
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn