objectARX动态块可见性获取例子
ads_name ent;ads_point pt;
if(RTNORM != acedEntSel(_T("\n选图块: "),ent,pt))
{
return;
}
AcDbObjectId objId;
acdbGetObjectId(objId,ent);
AcDbDynBlockReference dynBlkRef(objId);
if(!dynBlkRef.isDynamicBlock())
{
acutPrintf(_T("\n非动态块参照!"));
return;
}
AcDbDynBlockReferencePropertyArray props;
dynBlkRef.getBlockProperties(props);
for (int i=0;i<props.length();i++)
{
AcDbDynBlockReferenceProperty prop= props.at(i);
acutPrintf(_T("\n属性名:%s "),prop.propertyName());
if(_T("可见性") != prop.propertyName()) continue;
AcDbEvalVariantArray values;
prop.getAllowedValues(values);
for (int j=0;j<values.length();j++)
{
AcDbEvalVariant v= values.at(j);
AcString s;
v.getValue(s);
if(!s.isEmpty())
acutPrintf(_T("\n可见性名称:%s "),s);
}
}
页:
[1]