在网页中如何获取块文字信息?
MxDraw网页开发|冯美娟|2019-02-26 10:23
-
回答:
js实现代码如下:
var database = mxOcx.GetDatabase(); var blkTab = database.GetBlockTable(); var iter = blkTab.NewIterator(); for (; !iter.Done(); iter.Step(true, false)) { var blkRec = iter.GetRecord(); var iter1 = blkRec.NewIterator(); for (; !iter1.Done(); iter1.Step()) { var tmpEnt = iter1.GetEntity(); if (tmpEnt == null) continue; if (tmpEnt.ObjectName == "McDbText") { // 当前实体是一个文字 var text =tmpEnt; var txt=text.TextString; alert(txt.toString()); } } }