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

    function Delete?

    SDK Help
    0
    3
    312
    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

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

      On 18/05/2004 at 12:32, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.100 
      Platform:      
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      is there any way to delete/destroy object from the scene using COFFEE command???

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

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

        On 18/05/2004 at 15:46, xxxxxxxx wrote:

        Hi,

        the following example command plugin deletes the selected object. I hope it helps 🙂

        Ciao,
        Marcus

        ------------->8----------------
        <CODE>
        const var myID = 1000001;

        class DeleteObject : MenuPlugin
        {
            public:
              
                DeleteObject();
                GetID();
                GetName();
                GetHelp();
                GetState();
                Execute(curDocument);
        }

        DeleteObject::DeleteObject() { super(); }
        DeleteObject::GetID() { return myID; }
        DeleteObject::GetName() { return "DeleteObject"; }
        DeleteObject::GetHelp() { return "Deletes current object."; }

        DeleteObject::GetState()
        {
            var curDocument = GetActiveDocument();
            if (!instanceof(curDocument, BaseDocument)) {
                return 0;
            }
            var curObject = GetActiveObject(curDocument);
            if (!instanceof(curObject, BaseObject)) {
                   return 0;
            }
            return CMD_ENABLED;
        }

        DeleteObject::Execute(curDocument)
        {
            var curObject = GetActiveObject(curDocument);
            if (!instanceof(curObject, BaseObject)) {
                return;
            }
            if (!curObject->Remove()) {
                println("Could not delete object.");
            }
            GeEventAdd(DOCUMENT_CHANGED);
            return;
        }

        main()
        {
            Register(DeleteObject);
        }
        [/CODE}

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

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

          On 19/05/2004 at 03:00, xxxxxxxx wrote:

          thanks.

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