Hi,
In a package I create SMD pad with the following coordinates [mm]: x = -2.54, y = 2.8.
When I run the following ULP, the message displayed is "not OK", while it should be "OK":
package( P )
{
P.contacts( C )
{
real y = u2mm( C.y );
if( y == 2.8 )
{
dlgMessageBox( "OK" );
}
else
{
dlgMessageBox( "not OK" );
}
break;
}
}
Now, if I change the ULP to be as follows, the result is "OK":
package( P )
{
P.contacts( C )
{
real y = u2mm( C.y );
real d = u2mm( 28000 );
if( y == d )
{
dlgMessageBox( "OK" );
}
else
{
dlgMessageBox( "not OK" );
}
break;
}
}
Now I change the pad coordinates to [mm]: x = 2.46, y = 1.8 and run the following ULP and the result is "OK":
package( P )
{
P.contacts( C )
{
real y = u2mm( C.y );
if( y == 1.8 )
{
dlgMessageBox( "OK" );
}
else
{
dlgMessageBox( "not OK" );
}
break;
}
}
The question is, where is the problem? Is there a bug or am I doing something wrong?
Best regards,
Andrzej Telszewski