•  

    https://aveva.dev-verintcommunity.com/cfs-file/__key/communityserver-discussions-components-files/1635/280733GRATE.MAC

  • hi, Bobby

    possible to change to pane instead of box, file attached for your comment.
  • Hi, Bobby,

    I having problem to run this part, can please help me to modify it:
    [ATTACH=CONFIG]8201[/ATTACH]
  • Without loading it and trying it  I have to ask how much it would slow the graphics down? Most places I work at we use a single PANE with a correct MATREF for the grating spec to gain the weight, CofG etc. We then set the Grating in the AutoColour rules to have a 25% translucency so that it is obviously grating and not plating.

    I have to say, visually it looks good though :)
  • Yes, im also doing that way several times :)
    The current project my client does req. for weight/CoG report, thats why I created this macro
  • sorry, mistype
    client[COLOR=#ff0000] DOESNT [/COLOR]require
  • We had modify pml and macro from boby, the result like this :
  • please see this pml syntax below :


    -- Mansyur Usman (mansyur.usm@gmail.com)
    -- PML for Creating Grate for Structure

    setup form !!mangrate size 37.5 15
    Var !UserName Login
    Var !UserName UpCase(|$!UserName|)

    !THIS.FORMTITLE = 'Gratting Form for $!UserName'

    path d
    text .LX    'Panjang Gratting      ' at 0 1 width 10 is REAL
    text .LY   'Lebar Gratting        ' at 0 2 width 10 is REAL
    text .PW    'Tinggi Gratting       ' at 0 3 width 10 is REAL
    text .PT    'Tebal Plate           ' at 0 4 width 10 is REAL
    text .BSIZE 'Plate Horizontal      ' at 0 5 width 10 is REAL
    text .PX'Space Plate Horizontal' at 0 6 width 10 is REAL
    text .PY'Space Plate Vertical  ' at 0 7 width 10 is REAL
    text .NM'Nama Plate' at 0 8 width 22 is STRING


    frame .framepos 'Coordinat' at 0 9
    button .create 'Create' at 0.5 1 callback '!this.kerjakan()' backg green
    button .pickPos 'Position' at 23 1 callback '!this.pickPosition()' backg pink
    text .position 'Pos' at 0 3 width 28 is string

    exit
       
    define method .kerjakan()

    !LX = !this.LX.val
    !LY = !this.LY.val
    !PW = !this.PW.val
    !PT = !this.PT.val
    !BSIZE = !this.BSIZE.val
    !PX = !this.PX.val
    !PY = !this.PY.val
    !NM = !this.NM.val

    !PX = 40  $* PITCH XDIR
    !PY = 50  $* PITCH YDIR

    !IntX = INT ($!LX / $!PX)
    !IntY = INT ($!LY / $!PY)

    NEW STRUC
    NAME  /'$!NM'
    NEW SUBS


    NEW BOX XLEN $!PT YLEN $!LY ZLEN $!PW

    BY X ($!PT / 2) Y ($!LY / 2) Z ($!PW / 2)

    DO !x FROM 1 TO ($!IntX - 1)
     NEW BOX XLEN $!PT YLEN ($!LY - $!PT * 2) ZLEN $!PW

     BY X ($!PX * $!x + $!PT / 2) Y ($!LY / 2) Z ($!PW / 2)

    ENDDO

    NEW BOX XLEN $!PT YLEN $!LY ZLEN $!PW

    BY X ($!LX - $!PT / 2) Y ($!LY / 2) Z ($!PW / 2)


    NEW BOX XLEN $!LX YLEN $!PT ZLEN $!PW

    BY X ($!LX / 2) Y ($!PT / 2) Z ($!PW / 2)

    DO !y FROM 1 TO ($!IntY - 1)
    --  NEW BOX XLEN $!LX YLEN $!BSIZE ZLEN $!BSIZE

     NEW CYLI DIA $!BSIZE HEI $!LX
     ORI Y IS N AND Z IS E
     BY X ($!LX / 2) Y ($!PY * $!y + $!PT / 2) Z ($!PW - $!BSIZE / 2)
    ENDDO

    NEW BOX XLEN $!LX YLEN $!PT ZLEN $!PW

    BY X ($!LX / 2) Y ($!LY - $!PT / 2) Z ($!PW / 2)


    SUBS
    endmethod



    define method .pickPosition()
       -- Object Format to Control Decimal Precision.
       !format    = object format()
       !format.dp    = 1
       
       prompt dismiss
       prompt off
       prompt load escape 'Identify Element as Reference Position...'
       var !pick pick
       handle any
           prompt on
           return
       endhandle
       prompt on
       !dbref    = !pick[1].dbref()
       
       if (!dbref.hardtype.eq('SCTN') or !dbref.hardtype.eq('GENSEC')) then
           -- Get a LINE that represents the Start & End.
           !line    = !dbref.pose.line(!dbref.poss)
           -- Get a POINTVECTOR from the picked Element informations.
           !pickPos = object position(!pick[2].after(|Through|))
           !pickDir = object direction(!pick[2].after(|Line|).before(|Through|))
           !pVector = object pointvector(!pickPos, !pickDir)
           
           -- Derived the POSITION Picked along the SCTN.
           !pickPos = !line.intersection(!pVector)
           -- Get which is the Nearest (End or Start).
           if (!dbref.poss.distance(!pickPos).leq(!dbref.pose.distance(!pickPos))) then
               -- Position is at the START.
               !panePos    = !dbref.poss.wrt(world)
           else
               -- Position is at the END
               !panePos    = !dbref.pose.wrt(world)
           endif
       else
           -- Position is at the Origin of the Picked Element.
           !panePos    = !dbref.position.wrt(world)
       endif
       
       -- Set Value to Position:
       !this.position.val    = !panePos.string(!format)
       axes at $!panePos
    endmethod
  • Hi,

    Just nice...But I think it will slow down the loading time.
    In normal practice PANE do just fine.. as Frenchy mention.

    Anyway graphic is very nice and looks real.. good macro!!