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

    get object size?

    SDK Help
    0
    5
    414
    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

      On 12/10/2013 at 12:40, xxxxxxxx wrote:

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

      ---------
      hi, 
      to retrieve the size of a group of objects i had the idea to use the following code.
      however, it seems to not work. i searched the forum, but found only things i dont understand.

      Vector Handrail::getSize(BaseObject* o)
      {
      	Vector size = Vector(0);
      	BaseObject* temp = BaseObject::Alloc(Oconnector);
      	if (temp)
      	{
      		o->InsertUnder(temp);
      		size = temp->GetRad();
      		GePrint("Size:"+RealToString(size.y));
      	}
      	return size;
      }
      

      any help would be great 🙂 i am just looking for an easy way to get the dimension of a user defined object (and this object could be anything)

      thanks in advance,
      ello

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

        On 12/10/2013 at 13:30, xxxxxxxx wrote:

        GetRad() only works for objects that override that method in their NodeData, to return a proper bounding box dimension.

        If GetRad() doesn't work for you, you could also use the PolygonObject or PointObject of the generator, iterate over all points and use the MinMax class to calculate its extends.

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

          On 12/10/2013 at 13:38, xxxxxxxx wrote:

          you mean creating a clone of the provided object link and get the points of that one??

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

            On 17/10/2013 at 06:27, xxxxxxxx wrote:

            Howdy,

            Generator objects store a polygonal cache object which you can accessed with BaseObject::GetCache().
            There is a detailed description in the SDK Documentation on how caches work.

            Adios,
            Cactus Dan

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

              On 17/10/2013 at 12:40, xxxxxxxx wrote:

              thank you! that helps a lot...

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