AutoCAD开发8---获取块属性(C#)

public object GetValueByAttributeName(dbx.AcadBlockReference blkRef,string AttributeName) 
  { 
  object[] Atts=(object[])blkRef.GetAttributes(); 
  object attValue=null; 
  for (int i=0;i  
  { 
  dbx.AcadAttributeReference attRef; 
  attRef=(dbx.AcadAttributeReference)Atts[i]; 
  if (attRef.TagString==AttributeName) 
  { 
  attValue= attRef.TextString ; 
  break; 
  } 
  }//end of for i 
  return attValue; 
  }// end of function

转自:http://www.programfan.com/article/3161.html

posted on 2019-12-12 11:41  Lzhm216  阅读(1361)  评论(0编辑  收藏  举报

导航