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
    • Recent
    • Tags
    • Users
    • Login

    MCOMMAND_CURRENTSTATETOOBJECT

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 455 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

      On 05/11/2015 at 02:50, xxxxxxxx wrote:

      In R14 this piece of code to make an object a polygon object before inserting it in the document works:

      [   B_cyl = c4d.BaseObject(c4d.Ocylinder)
          B_cyl[c4d.PRIM_CYLINDER_CAPS] = False
          B_cyl[c4d.PRIM_CYLINDER_RADIUS] = 50
          B_cyl[c4d.PRIM_CYLINDER_HEIGHT] = 50
          B_cyl[c4d.PRIM_CYLINDER_HSUB] = 3
          B_cyl[c4d.PRIM_CYLINDER_SEG] = 36
          B_cyl[c4d.PRIM_AXIS] = 2
          
          
          B_cyl_to_obj = c4d.utils.SendModelingCommand(c4d.MCOMMAND_CURRENTSTATETOOBJECT, 
                                                      doc = doc, 
                                                      list = [B_cyl])
             
          B_cyl_obj = B_cyl_to_obj[0]    
          B_cyl_obj_pnts = B_cyl_obj.GetAllPoints()
              
          B_cyl_obj.InsertUnder(obj_null)]

      But in R12 and R13 it does not. Is there a workaround for this????

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

        On 06/11/2015 at 00:21, xxxxxxxx wrote:

        Ok, I have done this and it seems to be working. I created a temp document for my object and work from there.

        [B_cyl = c4d.BaseObject(c4d.Ocylinder)
            B_cyl[c4d.PRIM_CYLINDER_CAPS] = False
            B_cyl[c4d.PRIM_CYLINDER_RADIUS] = 50
            B_cyl[c4d.PRIM_CYLINDER_HEIGHT] = 50
            B_cyl[c4d.PRIM_CYLINDER_HSUB] = 3
            B_cyl[c4d.PRIM_CYLINDER_SEG] = 36
            B_cyl[c4d.PRIM_AXIS] = 2
                
            temp_doc = c4d.documents.BaseDocument()
            
            temp_doc.InsertObject(B_cyl)
            Bcyl_obj = temp_doc.SearchObject("Cylinder")
            
            B_cyl_to_pol = c4d.utils.SendModelingCommand(c4d.MCOMMAND_CURRENTSTATETOOBJECT, 
                                                         doc = temp_doc, 
                                                         list = [Bcyl_obj])
               
            B_cylObj = B_cyl_to_pol[0]    
            B_cylObj_pnts = B_cylObj.GetAllPoints()

        print B_cylObj_pnts
            ]

        Is there any cons going this way???

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

          On 06/11/2015 at 05:04, xxxxxxxx wrote:

          Hi,

          no, there speaks nothing against it. Actually your second solution is way safer than the first approach. SendModelingCommand() should always be send to objects, which reside in the passed document.

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

            On 06/11/2015 at 20:34, xxxxxxxx wrote:

            @Andreas Block

            Thanks I will stick with the second one

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