digikv Srbija
Član broj: 20460 Poruke: 75 *.pat-pool.kv.sbb.co.yu.
|
void _stdcall Func_OFFSET (unsigned long hDwg)
{
TCHAR szText[256];
TCHAR B[1]="B";
TCHAR b[1]="b";
int status,status1;
double x1,y1,z1;
m1:
CadCmdPrompt( hDwg, "Through point/<Distance> ", "" ); // u ovom redu treba iza <Distance> da dodam string koji pradstavlja trenutnu vrednost distanceoffset
status=0;
status = CadCmdUserInput( hDwg );
if (status == CAD_CCS_STRING){
CadCmdGetInputStr( hDwg, szText );
distanceoffset = atof(szText);
if (distanceoffset != 0) {
CadCmdPrompt( hDwg, "Select entity:", "" );
hEnt = CadCmdUserGetEntity( hDwg );
if (hEnt){
CadSelectEntity( hDwg, hEnt, 1 );
CadUpdate( hDwg );
CadCmdPrompt( hDwg, "Both sides/<Side for parallel copy>:", "" );
status1 = CadCmdUserInput( hDwg );
if (status1==CAD_CCS_STRING){
TraceLog( "xxx", "CAD_CCS_STRING" );
CadCmdGetInputStr( hDwg, szText );
if( strcmp(szText,B) | strcmp(szText,b) ){
CadDrawOffset( hDwg, hEnt, distanceoffset, 1, x1, y1 );
}else{
CadDrawOffset( hDwg, hEnt, distanceoffset, 0, x1, y1 );
}
}else{
if (status1==CAD_CCS_LBUTTON){
TraceLog( "xxx", "CAD_CCS_LBUTTON" );
CadCmdGetInputPoint( hDwg, &x1, &y1, &z1 );
CadDrawOffset( hDwg, hEnt, distanceoffset, 0, x1, y1 );
}
}
}
}
}
}
|