コード例 #1
0
    # Basic Fusion 360 Command Base samples
    from .commands.SampleCommand1 import SampleCommand1
    from .commands.SampleCommand2 import SampleCommand2

    # Palette Command Base samples
    from .commands.SamplePaletteCommand import SamplePaletteSendCommand, SamplePaletteShowCommand

    # Various Application event samples
    from .commands.SampleCustomEvent import SampleCustomEvent1
    from .commands.SampleDocumentEvents import SampleDocumentEvent1, SampleDocumentEvent2
    from .commands.SampleWorkspaceEvents import SampleWorkspaceEvent1
    from .commands.SampleWebRequestEvent import SampleWebRequestOpened
    from .commands.SampleCommandEvents import SampleCommandEvent

    # Create our addin definition object
    my_addin = apper.FusionApp(config.app_name, config.company_name, False)

    # Creates a basic Hello World message box on execute
    my_addin.add_command(
        'Sample Command 1',
        SampleCommand1,
        {
            'cmd_description': 'Hello World!',
            'cmd_id': 'apper_sample_cmd_1',
            'workspace': 'FusionSolidEnvironment',
            'toolbar_panel_id': 'Commands',
            'cmd_resources': 'command_icons',
            'command_visible': True,
            'command_promoted': True,
        }
    )
コード例 #2
0
    from .commands.ModifyPart import ModifyPart
    from .commands.ModifyPart import ModifyPartExternalCommandStarted
    from .commands.ModifyPart import ModifyPartExternalCommandEnded
    from .commands.SimpleJoint import SimpleJoint
    from .commands.SetAttributes import SetAttributes
    from .commands.ViewAttributes import ViewAttributes
    from .commands.ShowJointOriginsByBoundingBox import ShowJointOriginsByBoundingBox
    from .commands.PointsToJointOrigins import PointsToJointOrigins

    app = adsk.core.Application.cast(adsk.core.Application.get())
    ui = app.userInterface

    # Create addin definition object
    # global addin
    addin = apper.FusionApp('VEX CAD Library', 'VEX CAD', False)

    addin.add_command(
        'Modify Part', ModifyPart, {
            'cmd_description':
            'Modify parametric parts from the VEX CAD Library.\n\nSelect part component and change parameters.',
            'cmd_id': 'modify_part',
            'workspace': 'FusionSolidEnvironment',
            'toolbar_panel_id': 'Modify',
            'cmd_resources': 'command_icons/press_pull',
            'command_visible': True,
            'command_promoted': True,
        })
    addin.add_command_event("FusionImportCommandStartedEvent",
                            app.userInterface.commandStarting,
                            ModifyPartExternalCommandStarted)