How to display the preview by tabs

How to display the preview by tabs

Anonymous
419 Views
0 Replies
Message 1 of 1

How to display the preview by tabs

Anonymous
Not applicable

I'm writing the script which generate tool path for special situation (optimized for our machine).

 

Then I have a problem with tool path preview. 

My script has some tabs and generate tool path by tabs. So I want to display a preview of the active tab and hide tool paths of deactivated tabs.

 

For the purpose, I've tried to multiple create Preview Handler by tabs and connect to 'cmd.executePreview' but it don't go well.

There are no preview until parameters (in all tabs) is entered and tool path of deactivated tabs are existing.

 

In other words, I want to implement same thing as fusion manufacture methods.

The methods have a multiple tabs and display only the preview of active tab. (In geometry tab it shows us a stock outline / In heights tab it shows us a planes)

 

 

I've written the code like this,

 

class tab1preview(adsk.core.CommandEventHandler):

    def __init__(self):

        super().__init__()

    def notify(self, args):

        try:

            cmdArgs = ask.core.CommandEventArgs.cast(args)

            inputs = cmdArgs.command.commandInputs

            preview_tab1(inputs)  # function that preview the tool path is generated by tab1 parameters

 

class tab2preview(adsk.core.CommandEventHandler):

    def __init__(self):

        super().__init__()

    def notify(self, args):

        try:

            cmdArgs = ask.core.CommandEventArgs.cast(args)

            inputs = cmdArgs.command.commandInputs

            preview_tab2(inputs)  # function that preview the tool path is generated by tab2 parameters

 

class CmdCreatedHandler(ask.core.CommandCreatedEventHandler):

----

    def notify(self, args):

        try:

            cmd = ask.core.Command.cast(args.command)

 

            ontab1preview = tab1preview()

            cmd.executePreview.add(ontab1preview)

            _handlers.append(ontab1preview)

 

            ontab1preview = tab2preview()

            cmd.executePreview.add(ontab2preview)

            _handlers.append(ontab2preview)

 

 

0 Likes
420 Views
0 Replies
  • API
Replies (0)