VDF常見問題整理(二十五):如何隱藏自定義ACAD對象?
VectorDraw Developer Framework(VDF)是一個用于應(yīng)用程序可視化的圖形引擎庫。有了VDF提供的功能,您可以輕松地創(chuàng)建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。
VectorDraw Developer Framework試用版下載
點(diǎn)開本篇文章,是否對矢量圖形工具感興趣呢?來看看最新的矢量圖形工具測評吧!點(diǎn)擊此處>>即可直達(dá)哦!
問:
隨附的圖形在VDraw和AutoCAD中看起來不同。有什么方法可以過濾VdfCAD / VDraw中不需要的AecDb…-vdInserts?
答:
您可以嘗試使用AfterOpen事件來過濾此類塊/實(shí)體,并將其隱藏在凍結(jié)層中。例如嘗試代碼:
private void button5_Click(object sender, EventArgs e) { doc = vdFramedControl1.BaseControl.ActiveDocument; doc.OnAfterOpenDocument += new vdDocument.AfterOpenDocument(doc_OnAfterOpenDocument); doc.Open(@"MyDrawing.dwg"); } void doc_OnAfterOpenDocument(object sender) { vdLayer aeclay = doc.Layers.FindName("AECLAYER"); // THE layer where these are going to be hidden if (aeclay == null) { aeclay = new vdLayer(doc, "AECLAYER"); doc.Layers.AddItem(aeclay); } aeclay.Frozen = true; // set to frozen foreach (vdBlock item in doc.Blocks) // check all blocks { bool is_aec = false; foreach (vdFigure fig in item.Entities) { vdText txt = fig as vdText; if (txt != null) {// Filter is to contain the text AecDb.. and has less than 3 items / // You can alter this filter as you like. if (txt.TextString.ToUpper().Contains("AECDB") && item.Entities.Count<3) {// that contain the string AecDB... is_aec = true; break; } } } if (is_aec) { foreach (vdFigure fig in item.Entities) { fig.Layer = aeclay; // hide the entities of this block } is_aec = false; } } }
對于以上問答,如果您有任何的疑惑都可以在評論區(qū)留言,我們會及時回復(fù)。此系列的問答教程我們會持續(xù)更新,如果您感興趣,可以多多關(guān)注本教程。
相關(guān)資料推薦:
點(diǎn)擊此處還有VectorDraw Developer Framework的demo示例等著你來體驗(yàn)哦!
如果您對想要購買正版授權(quán)VectorDraw Developer Framework(VDF),可以聯(lián)系咨詢相關(guān)問題。
關(guān)注慧聚IT微信公眾號 ???,了解產(chǎn)品的最新動態(tài)及最新資訊。