Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Returning correct unit values

    SDK Help
    0
    4
    417
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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)

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          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[URL-REMOVED]& val, LONG format, LONG fps, Bool bUnit = TRUE) instead


          [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post