VDF常見(jiàn)問(wèn)題整理(二十五):如何隱藏自定義ACAD對(duì)象?
VectorDraw Developer Framework(VDF)是一個(gè)用于應(yīng)用程序可視化的圖形引擎庫(kù)。有了VDF提供的功能,您可以輕松地創(chuàng)建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。
VectorDraw Developer Framework試用版下載
點(diǎn)開(kāi)本篇文章,是否對(duì)矢量圖形工具感興趣呢?來(lái)看看最新的矢量圖形工具測(cè)評(píng)吧!點(diǎn)擊此處>>即可直達(dá)哦!
問(wèn):
隨附的圖形在VDraw和AutoCAD中看起來(lái)不同。有什么方法可以過(guò)濾VdfCAD / VDraw中不需要的AecDb…-vdInserts?
答:
您可以嘗試使用AfterOpen事件來(lái)過(guò)濾此類(lèi)塊/實(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; } } }
對(duì)于以上問(wèn)答,如果您有任何的疑惑都可以在評(píng)論區(qū)留言,我們會(huì)及時(shí)回復(fù)。此系列的問(wèn)答教程我們會(huì)持續(xù)更新,如果您感興趣,可以多多關(guān)注本教程。
相關(guān)資料推薦:
點(diǎn)擊此處還有VectorDraw Developer Framework的demo示例等著你來(lái)體驗(yàn)哦!
如果您對(duì)想要購(gòu)買(mǎi)正版授權(quán)VectorDraw Developer Framework(VDF),可以聯(lián)系在線客服>>咨詢(xún)相關(guān)問(wèn)題。
關(guān)注慧聚IT微信公眾號(hào) ???,了解產(chǎn)品的最新動(dòng)態(tài)及最新資訊。