Returning correct unit values



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 03/12/2012 at 16:43, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R14 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    Hi Folks,
     
    I'm getting a points position vector but it's returning the unit in CM's instead of the documents mm. This is causing the print to show an incomplete unit position data. If my document is in mm's for instance, and my point position is x=1000.562, y=1000.778, z=1000.426, the GePrint will only return x=100.056 etc, and is thus leaving off the third decimal place from the original unit type.
     
    What's the work around for this? Example code I'm using below:
     
    LONG a;
    a = CP _[a];     // CP is CPolygon, i is polygon number, a is the point I'm getting from number i polygon
    GePrint("Position x = " + RealToString[a].x);
     
    Cheers,
     
    WP.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 04/12/2012 at 02:49, xxxxxxxx wrote:

    Try setting the digits after the decimal point explicitly, as supported by RealRoString:

    String RealToString(Real v, LONG vvk, LONG nnk, Bool e, UWORD xchar)



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 04/12/2012 at 06:17, xxxxxxxx wrote:

    use FormatNumber(const GeData& val, LONG format, LONG fps, Bool bUnit = TRUE) instead



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 17/12/2012 at 22:33, xxxxxxxx wrote:

    Thanks folks,
     
    have managed to get this one working. My apologies for the late acknowledgement - a few things on the go at the mo!
     
    WP.


Log in to reply