🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Insert a descriptive picture in a macro

User: "Anersan"
Altair Community Member
Updated by Anersan

Hello,

I would like to know how could I insert a picture showing the parameters concerning my own macro

For exemple, if the macro draws a box, the user has to enter 3 parameters

image

When I execute the macro, it opens correctly, but there is no picture

image

 

For exemple, if you want to create an InfiniteBox, there is a picture showing you de dimensions you have to enter

image

You can even make the picture visible or invisible with the "Image" (in french version) button.
   

Does anyone know how to do this?

Regards!

Andres

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "asoualmi"
    Altair Employee
    Accepted Answer
    Updated by asoualmi

    Hi,

    There is an example of macro inside there a script allows to add a picture in the macro. The macro is:

    reateInitialNonMeshedCoilFor3DRadialMotor.PFM

    It is available in:

    C:\Program Files\Altair\2020\flux\Extensions\Macros\Macros_Flux3D_Physics\CreateInitialNonMeshedCoilFor3DRadialMotor.PFM

    The part of the scrip is :

    if isActif ==False:

     

    INSTALL = os.environ["INSTALLFLUX"]+ os.path.sep + ".."

    image_filename = INSTALL+os.path.sep+"Extensions"+os.path.sep+"Macros"+os.path.sep+"Macros_Flux3D_Physics"+os.path.sep+"CreateInitialNonMeshedCoilFor3DRadialMotor.PFM"+os.path.sep+ "CreateInitialNonMeshedCoilFor3DRadialMotor.jpg"

    print image_filename

     image = imageio.ImageIO.read(io.File(image_filename))

    frame = JFrame('DATA Description',

               defaultCloseOperation = JFrame.DISPOSE_ON_CLOSE,

               size = (1290,870))

    label = JLabel(ImageIcon(image))

    label.setHorizontalAlignment(JLabel.RIGHT);

    label.setVerticalAlignment(JLabel.BOTTOM);

    frame.add(label)

    frame.setAlwaysOnTop(True)

    frame.visible = True

     

    Best regards.