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

    Generating new object and tag

    SDK Help
    0
    3
    197
    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/10/2006 at 03:35, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9.5 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hello,

      I have a Menu-Plugin that is supposed to create a new object and then insert my own tag to that object. But when I run it, it closes C4D without any message whatsoever. Here's my code for the Menu-Plugin Execute:

        
      Bool GenStation::Execute(BaseDocument *doc)  
      {  
      BaseObject *op = BaseObject::Alloc(Onull);            
      op->SetName("S/C");  
      doc->InsertObject(op,doc->GetActiveObject(),NULL,TRUE);  
      BaseTag *StationTag = (BaseTag* )TagStation::Alloc();  
      op->InsertTag(StationTag);  
      EventAdd();  
      return TRUE;  
      } 
      

      If I take out the line

      op->InsertTag(StationTag)
      

      , then everything works fine, but obviously I don't have the tag on my object then ... any ideas?

      cheers, Juergen

      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/10/2006 at 04:46, xxxxxxxx wrote:

        If the tag is one of yours, you'll need to call it like this:

        BaseTag* StationTag = PluginTag::Alloc(YOUR_UNIQUE_ID);

        It is also always a good idea to check for NULL (in this case 'op' and 'StationTag' after the Alloc()).

        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 23/10/2006 at 01:27, xxxxxxxx wrote:

          Thanks Robert, that solved the problem! I also included the checks for NULL ...

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