Custom statements

Forum Forums Visual Components 4.1 .NET Addon Programming Custom statements

This topic contains 3 replies, has 3 voices, and was last updated by Keke Keke 4 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9003
    Avatar
    bart1998
    Participant

    I would like to make some custom statements for VC with the .net plugin. I think i need ICustomStatement, but i am not sure. I cannot find any information or examples about this. Is there anyone with an example or short explanation of how this works?

    #9036
    Avatar
    bart1998
    Participant

    From the documentation i see that i have to use CustomStatementBase. But i am not sure how to add that to the menu and add an icon.

    #10697
    Jay
    Jay
    Moderator

    Hi,

    Below is the basic implementation of custom statements. I stopped writing the code after I realized a major issue with this approach. The custom statement plugin will only work on application with the custom statement dll in the application folder. That means if you program a robot and then send the layout to someone, that person will not be able to open the layout with the robot program intact unless they have your custom statement dll in their application folder.

    A better approach is to create a process statement on python API and then attach it to a process handler script and then write your logic in the script.

    Anyway here is the basic implementation of ICustomStatement.

     

     

     

     

    #14490
    Keke
    Keke
    Moderator

    Hi,

    I tested Jay’s code and it works. One small thing is that executor doesn’t seem to move on to the next statement by itself. Calling executor.Continue() at the end of CustomStatement.Execute() seems to do the trick. With python process handler the behavior is different and execution continues by itself.

    -k

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.