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

    How to create an XRef object

    Scheduled Pinned Locked Moved PYTHON Development
    9 Posts 0 Posters 999 Views
    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 Offline
      Helper
      last edited by

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

      On 28/07/2011 at 01:22, xxxxxxxx wrote:

      How do I create an XRef object in Python (or with C++ API, for that matter)? I can't even find a single mention of XRef in the Python documentation; am I missing something?

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

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

        On 28/07/2011 at 04:07, xxxxxxxx wrote:

        Use the BaseObject constructor.

        import c4d   
        op = c4d.BaseObject(c4d.Osceneinstance)   
        doc.InsertObject(op)
        

        Edit summary: corrected constant

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

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

          On 28/07/2011 at 04:33, xxxxxxxx wrote:

          If you want to get the ID of an object you can drag it into the Python console. You can pass this ID to BaseList2D or in this case to BaseObject. Cheers, Sebastian

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

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

            On 28/07/2011 at 05:34, xxxxxxxx wrote:

            @ Sebastian: When dragging an Object into the Console, I recieve this:

            But the constant Osceneinstance is not available in the C4D Module.

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

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

              On 28/07/2011 at 05:35, xxxxxxxx wrote:

              Originally posted by xxxxxxxx

              op = c4d.BaseObject(c4d.Oxref) 
              

              On Cinema 4D R12.048 RC42839, I don't have c4d.Oxref:

              Traceback (most recent call last) :
                File "<console>", line 1, in <module>
              AttributeError: 'module' object has no attribute 'Oxref'
              

              EDIT: Oh, I see, it's a general problem. What's the numeric value of the Oxref?

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

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

                On 28/07/2011 at 05:37, xxxxxxxx wrote:

                Do I need a newer Cinema 4D version?

                No, I'm sorry, I used the wrong ID. For the correct ID, see the post above. But that id is also not available in the c4d module which seems like a bug to me.

                Use print op.GetType() for the integer ID. (which is 200000118)

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

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

                  On 28/07/2011 at 05:39, xxxxxxxx wrote:

                  Originally posted by xxxxxxxx

                  Use print op.GetType() for the integer ID. (which is 200000118)

                  Thanks, I'll try that.

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

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

                    On 28/07/2011 at 08:59, xxxxxxxx wrote:

                    Currently just a bunch of certain IDs  are part of the module. In this case you can drag the object to the console, extract the ID with GetType() and define them on your own.

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

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

                      On 04/08/2011 at 01:47, xxxxxxxx wrote:

                      Thanks, determining the type ID and constructing a new BaseObject with it worked great!

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