No. of sheets report in isometric

 
  • Nice piece of work Rhel. Thanks for sharing.
  • [COLOR=#417394]@rhel[/COLOR][COLOR=#3E3E3E]  Thank you very much for the macro. very much needed macro for such type of project. where number of ISO sheets =  number of pipes.

    [/COLOR]
  • [QUOTE=rhel;116924]I did create a macro for this requirements, hopefully it will helps and provide you the idea on how it works. This macro will extract a single PIPE only but it any case that you want to Batch extract, you List all your PIPE and run the macro at List Run Command option.

    This macro will create a separate file that will records the number of output piping isometric drawings / sheets with the corresponding Pipe Name.


    Just got what I was searching for, Thanks rhel !!. Works perfectly...
  • [QUOTE=rhel;116924]I did create a macro for this requirements, hopefully it will helps and provide you the idea on how it works. This macro will extract a single PIPE only but it any case that you want to Batch extract, you List all your PIPE and run the macro at List Run Command option.

    This macro will create a separate file that will records the number of output piping isometric drawings / sheets with the corresponding Pipe Name.

    Thanks Rhel for sharing the logic. This helps a lot.

    Regards,
  • hI friend the link is not available can you share it again thank you

  • --
    -- File:    aphPipeIsometric.pmlmac
    -- Author:  Aurelio Peros Hinampas
    -- Created: September 15, 2020
    -- Email:   hinrey12@gmail.com
    -- Module:  Design / Isodraft
    --
    -- Description: Macro to extract piping isometric and get the number of isometric drawings (no. of sheets).
    --            : Rename output drawings (DXF, PDF, PLT) to the desired naming format - Strip out file auto sheet number -001, -002 & so on..
    --            : This macro will extract Isometric for All PIPE within CE.
    --
    --     Callout: Drag & Drop to your command window or use the run macro method $M file.
    --
    
    
    -- Collect All Pipes within CE
    var !allPipes collect all (PIPE) for CE
    
    if (!allPipes.size().eq(0)) then
      return error 1 'No Pipe to be process, CE & Below does not have any PIPE.'
    endif
    
    !currProject = CURRENT PROJECT
    !projectCode = !currProject.code()
    
    -- Replace path of the isometric option file as with your requirements
    !isdOptFile  = object FILE(!!evar('$!<projectCode>ISO') & '\STD\previewisostd.txt')
    
    if (!isdOptFile.exists().not()) then
      -- Project option file is not define, look for the Aveva default Iso option file.
      !isdOptFile = object FILE(!!evar('PDMSDFLTS') & '\STD\previewisostd.txt')
    endif
    
    if (!!module().appkey.eq('des')) then
      ISODRAFTMODE
    endif
    
    -- Loop through to !allPipes and Generate Iso
    do !pipeRefe values !allPipes
      -- Set CE to PIPE
      $!pipeRefe
      
      $M "$!isdOptFile"
      handle any
        if (!!module().appkey.eq('des')) then
          EXIT
        endif
        return error 1 '$!!error.text'
      endhandle
    
      File SET PDF NoView Nocomp BW Bindpages
      
      DETAIL CE
      handle any
        -- Handles any failed iso extraction
        $P $!!<ce.name> - $!!error.text
      endhandle
      
      -- Get the list of extracted drawings
      var !isoSheetCount ISODRAW NUMBER
      handle any
        !isoSheetCount = '0'
      endhandle
      
      do !plot to !isoSheetCount.real()
        var !plotFile ISODRAW PLOTFILE $!<plot> FILENAME
        var !pipeName ISODRAW PLOTFILE $!<plot> DRAWING 1 TITLE
        var !sheetNum ISODRAW PLOTFILE $!<plot> DRAWING 1 SHEET
        
        -- Output Filename as per PIPE name
        !outFileName = !pipeName.replace(|"|, '').replace('/', '').replace('\', '')
        
        -- 2-digits sheet numbering format
        if (!sheetNum.real().lt(10)) then
          !sheetSeq = '-0' & !sheetNum
        else
          !sheetSeq = '-' & !sheetNum
        endif
        
        !fileTypes = split('dxf,hit,pdf,plt', ',')
        
        do !fileType values !fileTypes
          !outPlotFile = object FILE(!plotFile.after('/') & '.$!<fileType>')
          !autoSheetNo = !outPlotFile.entry().before('.$!<fileType>').split('-').last()
          
          -- -- Output New Filename as per PIPE name
          -- !newFileName = object FILE(!outPlotFile.directory() & '\' & !outFileName & !sheetSeq & '.$!<fileType>')
          
          -- Strip out file auto sheet number 001, 002 & so on
          !newFileName = object FILE(!outPlotFile.directory() & '\' & !outPlotFile.entry().before('-$!<autoSheetNo>') & '.$!<fileType>')
          
          if (!newFileName.exists()) then
            -- Delete previous filename if does exists
            !newFileName.deletefile()
            handle any
              $P Unable to delete $!newFileName - $!!error.text
            endhandle
          endif
          
          if (!outPlotFile.exists()) then
            -- Copy output drawing and rename to the new filename then delete after
            !outPlotFile.copy(!newFileName)
            PAUSE 1
            !outPlotFile.deletefile()
            handle any
              -- Unable to delete file, maybe file is currently used as isometric preview
            endhandle
          endif
          -- Plot file without file extension (*.*)
          !pltFileNoExt = object FILE(!plotFile.after('/'))
          if (!pltFileNoExt.exists()) then
            !pltFileNoExt.deletefile()
            handle any
              $P Unable to delete $!pltFileNoExt - $!!error.text
            endhandle
          endif
        enddo
      enddo
    enddo
    
    if (!!module().appkey.eq('des')) then
      EXIT
    endif
    
    

    Please see the attached requested file for the macro to extract piping isometrics at CE Level and will strip out the file auto sheet number -001, -002 & so on.

  •  

    Hello Rhel,

    I think we can extract sheet numbers from BOLT MTO file or MATL file without going in process of extracting Isometrics and gathering the information wrt to number of sheets extracted. We can check the value inside Bolt file / matl file regarding page and put that value in one of the designated Attribute.

    Correct me if I am wrong. I have not tried it but I think it is possible. Because extracting ISO will take more time as compared to this method.