void DemoShape4 (HANDLE hLcWnd)
{
HANDLE hDrw, hBlock, hFill, hEnt;
double Xc, Yc, Size;
WCHAR* szNameFill = L"Hatch 1";
// get a drawing and a block, linked with CAD window
hDrw = lcPropGetHandle( hLcWnd, LC_PROP_WND_DRW );
hBlock = lcPropGetHandle( hLcWnd, LC_PROP_WND_BLOCK );
// check if the filling style with specific name already exist
hFill = lcDrwGetObjectByName( hDrw, LC_OBJ_LINFILL, szNameFill );
if (hFill == 0){
// don't exist, add it
hFill = lcDrwAddFilling( hDrw, szNameFill );
// define the hatch lines
lcFillSetLine( hFill, 0, 1.0, 45.0*LC_DEG_TO_RAD, 0.5 );
lcFillSetLine( hFill, 1, 1.0, -45.0*LC_DEG_TO_RAD, 0.5 );
}
Xc = 50;
Yc = 25;
Size = 20;
// begin Shape entity
lcBlockBeginShape( hBlock );
// Fig 1 outside
lcBlockAddRect( hBlock, Xc, Yc, Size, Size, 0, false );
// Fig 2 inside
lcBlockAddCircle( hBlock, Xc, Yc, Size/4.0, false );
// add Shape entity
hEnt = lcBlockAddShape( hBlock );
// set filling style
lcPropPutHandle( hEnt, LC_PROP_ENT_LINFILL, hFill );
// undate view
lcBlockUpdate( hBlock, true, 0 );
lcWndZoomRect( hLcWnd, Xc-Size, Yc-Size, Xc+Size, Yc+Size );
}