Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ E3D Design

User-definable Material Macro

  • Last UpdatedApr 24, 2023
  • 2 minute read

You may modify the sample macro, bocgetusermatl.pmlfnc, as named by the !!bocMaterialMac global variable and given in the bocad\dflts\user\bocpml\functions folder in the user data folder, if you have specific requirements as to where the material information resides. The bocgetusermatl.pmlfnc function can then be modified. Once modified, you should execute a PML REHASH ALL command.

The example macro is as follows:

define function !!bocGetUserMatl( ) is STRING

  -- initialization

  !material = STRING( )

  !material = |unset|

  !start = ( ref )

  -- Set default material

  !defaultMaterial = |St 37-2|

  -- Some User specific PML to get the required info

  !type = ( type )

  if( !type eq |GENSEC| )then

    -- Material stored on Catalogue component

    goto catr

    handle any

      -- Bad or null reference

      !material = !defaultMaterial

      golabel /Finished

    endhandle

    !material = ( :Material )

    handle any

      !material = !defaultMaterial

      golabel /Finished

    endhandle

    if( !material eq |unset| or $

        !material.unset( ) or $

        !material.length( ) eq 0 )then

      -- Use default material

      !material = !defaultMaterial

    endif

  elseif( !type eq |PANE| )then

    -- Try to return :FABMGRADE or default material

     !material = ( :FABMGRADE )

    if( !material eq |unset| or $

        !material.unset( ) or $

        !material.length( ) eq 0 )then

      -- Use default material

      !material = !defaultMaterial

    endif

  endif

  -- Return string and exit

  label /Finished

  $!start

  return !material

endfunction

The above example assumes that the material information for GENSECs resides on the catalogue component in the UDA :MATERIAL. If, for any reason, a material cannot be identified, a default value of 'St 37-2' is assigned.

The application assumes, by default, that this file exists under the above name in a folder below the %PMLLIB% search path, and that the starting point for database navigation is the current element under consideration, that is a Section, a GENSEC or Panel. for further information of how you can configure the system to use a material macro with a name of your choice, refer to User-definable Material Macro for further information.

Note:
In writing your own macro, you must handle all errors encountered so that the macro will always safely return a valid PML string, whatever it may be.
Also, that materials for Panels must also be determined using this macro.

Regarding the naming of this macro, refer to User-definable Material Macro for further information.

TitleResults for “How to create a CRG?”Also Available in