Code sample Home

Rotate all block's references which match specified attribute
void DemoBlockAtt3 (HANDLE hLcWnd)
{
  HANDLE hBlock, hEnt;
  double Ang;
  WCHAR* szTag = L"QTY";
  WCHAR* szValue = L"7";

  // get a block, linked with CAD window
  hBlock = lcPropGetHandle( hLcWnd, LC_PROP_WND_VIEWBLOCK );
  // unselect all entities
  lcBlockUnselect( hBlock );
  // select all block references with specified attribute value
  hEnt = lcBlockGetBlkRefByTag( hBlock, szTag, szValue, true );
  if (hEnt){
    // rotate selected BlockRefs around insertion point
    hEnt = lcBlockGetFirstSel( hBlock );
    while( hEnt != 0 ){
      Ang = lcPropGetFloat( hEnt, LC_PROP_BLKREF_ANGLE );
      Ang += 5.0*LC_DEG_TO_RAD;
      lcPropGetFloat( hEnt, LC_PROP_BLKREF_ANGLE, Ang );
      hEnt = lcBlockGetNextSel( hBlock );
    }
    // unselect all entities
    lcBlockUnselect( hBlock );
    // update view
    lcWndRedraw( hLcWnd ); 
  }
}
See Also:

Code sample 1,   Code sample 2