Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Create Xref with python

    PYTHON Development
    0
    4
    629
    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 18/10/2014 at 11:53, xxxxxxxx wrote:

      I've found a couple posts about this but no clear answers.
      https://developers.maxon.net/forum/topic/8036/10449_xref-python-command

      Is it possible to create an Xref object and pass in a file path using python rather than just opening the dialog to search for it? If so, does someone have a code snippet they can share?

      EDITED:
      I've got this going so far, but the filepath isn't updating. I guess maybe I need to load a file into the Xref object?

        
      import c4d   
        
      def main() :   
          op = c4d.BaseObject(c4d.Oxref)   
          rocket = "/component1.c4d"   
          op.GetObjectLink(rocket)   
          op[c4d.ID_CA_XREF_FILE_SELECT] = "component1.c4d"   
          op[c4d.ID_CA_XREF_NAMESPACE] = "rocket"   
          op[c4d.ID_CA_XREF_GENERATOR] = 1   
          box = c4d.BaseObject(c4d.Ocube)   
          box.SetName("new")   
          doc.InsertObject(box)   
          doc.InsertObject(op)   
          c4d.EventAdd()   
        
      
      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 20/10/2014 at 00:59, xxxxxxxx wrote:

        Hello,

        Due to some limitations it is currently not possible to set the filename parameter of a Xref object in Python.

        Best wishes,
        Sebastian

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

          On 21/10/2014 at 08:43, xxxxxxxx wrote:

          Any idea of when this will be fixed?

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

            On 21/10/2014 at 09:59, xxxxxxxx wrote:

            Sorry, I don't know when this will be fixed.

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