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

    Getting points and edges of parametric objects

    Cinema 4D SDK
    python
    2
    5
    910
    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.
    • K
      kalugin
      last edited by

      Hi folks. Is there a way to use the "GetNearest" functions on parametric objects ? Like Cube and Sphere and so on.

      ViewportSelect.GetNearestEdge(op, x, y, maxrad=MAXLONGl, onlyselected=False, ignorelist=None, ignorecnt=0)

      If the target object is not editable I get:
      RuntimeError: Object is not initialized yet

      I've tried currentstate and makeeditable, but the result is the same.

      1 Reply Last reply Reply Quote 0
      • Passion3DP
        Passion3D
        last edited by

        Hi Kalugin
        A parametric object cannot be used in point, edge or polygon mode. You need to convert it to a polygonal object

        1 Reply Last reply Reply Quote 0
        • K
          kalugin
          last edited by

          what if I want to code my own snapping ? How can you snap to points of parametric objects ?

          1 Reply Last reply Reply Quote 0
          • Passion3DP
            Passion3D
            last edited by

            Make a clone, which you then delete, which serves as a reference and reports the coordinates on your parametric object.
            This is the principle I use in my OnFloor plugin, to position a parametric object on the ground.

            1 Reply Last reply Reply Quote 0
            • K
              kalugin
              last edited by

              Nevermind. I figured it out 🙂 It was my mistake in the code. I made myself a helper function to initialize the ViewportSelect object, and I was initializing it with the wrong object. That's where the runtime error came from. Thanks anyway.

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