How do i generate a bolt report by line and by material in excel form. Currently i have a macro which runs by line but the its not tabulated as how we could generate piping MTO.
I have seen the output of bolt report in text form. Appreciate if someone willing to share.
This application was created by me for one of my admin freind.....I have not worked on this further....pls see if this can be useful for you....this is in csv format....
Just copy the files in your PMLLIB folder. When you save the files from PDMS Forumn they will be saved with double dot....remove one dot.
Do, PML REHASH ALL
PML INDEX
in command line
then u can call the form in design using show !!boltrepfrm
Click on the created report staying on the zone to get the pipe wise bolt report.
I have a similar macro but I have found that in PDMS 11.6.SP5 or PDMS 12, if you run a high no of isometrics (let's say more than 50) from Design using ISODRAFTMODE, PDMS will eventually crash. So instead of generated a report of bolts for a full site, we have to do it per zone until PDMS crashes and start again...
[QUOTE=prashantuparkar;47200]Just copy the files in your PMLLIB folder. When you save the files from PDMS Forumn they will be saved with double dot....remove one dot.
Do, PML REHASH ALL
PML INDEX
in command line
then u can call the form in design using show !!boltrepfrm
Click on the created report staying on the zone to get the pipe wise bolt report.
No error.
It is just warning you that you have two short itemcodes from more than one pipe spec.
For example you could have two elements whose sprefs are rispectively /A150/ABCDEF:100 and /A300/ABCDEF:100
So in the Itemcode column of your material list you will have "ABCDEF" value two times.
At least this is what I think....
(33:294) Starting Bolt Report for PIPE /1-A1-0771700-SBJ01-NI.01
(33:235) Warning: Material list has short itemcodes from more than one pipe spec
(61:389) Using NEW bolting method
It does pretty much what Prashantuparker's function does, except the values are totalled up (IMO of more use to a purchasing engineer), the BOLTREPORT is stripped of inconsequential lines (wrt a subtotalled report), it's a bit tidier in terms of file handling and due to this is probably a bit more robust when there are network issues.
It's by no means complete. There is no error handling and it could probably benefit from creating an alpha log to keep track of any bolt errors that crop up. There's probably more that could be done.
I also think that it would probably work best sitting at a designer configured group world, although there is no code enforcing that. In any case it should work at PIPE or BRAN level.
If anyone would like to comment or suggest performance enhancements, please feel free.
-- Mostly written by Randalf :)
DEFINE FUNCTION !!test()
-- Enter sub-mode and collect all pipes
ISODRAFTMODE
VAR !pipeColl COLLECT ALL PIPE FOR CE
ALPHA FILE /c:\temp\BOLT\BOLTFILE over
ALPHA FILE END
BOLTING UNITS METRIC
DO !i FROM 1 TO !pipeColl.size()
MESS /c:\temp\mess over
BOLTFILE /c:\temp\BOLT\BOLTFILE
BOLTREPORT $!pipeColl[$!i]
HANDLE(42,65)
!!alert.error('BOLT DIA MISMATCH ON PIPE '& $!pipeColl[$!i])
ENDHANDLE
ENDDO
EXIT
-- Read report and strip out irrelevent lines
!input = object file ('C:\temp\BOLT\BOLTFILE')
!boltArray = !input.readfile(100000)
!boltArrayCompress = ARRAY()
DO !i indices !boltArray
SKIP IF (!boltArray[!i].EMPTY())
SKIP IF (!boltArray[!i].OCCURS('Page') GE 1)
SKIP IF (!boltArray[!i].OCCURS('LENGTH ' ) GE 1 AND !boltArray[!i].OCCURS('QTY ' ) GE 1)
SKIP IF (!boltArray[!i].OCCURS('BOLT ' ) GE 1 AND !boltArray[!i].OCCURS('DESCRIPTION ') GE 1)
SKIP IF (!boltArray[!i].OCCURS('---------------- ') GE 1 AND !boltArray[!i].OCCURS('--------- ' ) GE 1)
SKIP IF (!boltArray[!i].OCCURS('PIPELINE ' ) GE 1 AND !boltArray[!i].OCCURS('REF ' ) GE 1)
SKIP IF (!boltArray[!i].OCCURS('BATCH ' ) GE 1 AND !boltArray[!i].OCCURS('REF ' ) GE 1)
SKIP IF (!boltArray[!i].OCCURS('PIPING ' ) GE 1 AND !boltArray[!i].OCCURS('SPEC ' ) GE 1)
SKIP IF (!boltArray[!i].OCCURS('bolts ' ) GE 1 AND !boltArray[!i].OCCURS(' found' ) GE 1)
!tempLine = !boltArray[!i].trim()
!tempLine = !boltArray[!i].trim( 'M' , ' ')
!tempArray = !tempLine.split()
!finalArray = ARRAY ()
IF (!tempArray.size() GE 10) THEN
!finalArray = !tempArray[!tempArray.size()]
!finalArray[5] = !tempArray[!tempArray.size() - 1]
!finalArray[4] = !tempArray[!tempArray.size() - 2]
!finalArray[3] = !tempArray[!tempArray.size() - 3]
!finalArray[2] = !tempArray[!tempArray.size() - 4]
!finalArray[1] = !tempArray[1]
DO !x FROM 2 TO !tempArray.size() - 5
!finalArray[1] = !finalArray[1] + ' ' + !tempArray[!x]
ENDDO
!boltArrayCompress.append(!finalArray)
ENDIF
IF (!tempArray.size() LT 10) THEN
!finalArray[1] = !tempArray[1]
DO !x FROM 2 TO !tempArray.size()
!finalArray[1] = !finalArray[1] + ' ' + !tempArray[!x]
ENDDO
!desc = !boltArrayCompress[!boltArrayCompress.size()][1]
!desc = !desc + ' ' + !finalArray[1]
!boltArrayCompress[!boltArrayCompress.size()][1] = !desc
ENDIF
ENDDO
-- Consider adding something to check if any bolt items have been added as MTOREFs and then append to !boltArraycompress
-- Sort on 2d array description
DO !x from 1 to !boltArrayCompress.size()
!arrDesc[!x] = !boltArrayCompress[!x][1]
ENDDO
!arrNewIndex = !arrDesc.sortedindices()
!boltArrayCompress.reindex(!arrNewIndex)
-- Subtotal into new array
!subTotalArray = ARRAY()
!subTotalArray[1][1] = 'BOLT DESCRIPTION'
!subTotalArray[1][2] = 'NS'
!subTotalArray[1][3] = 'LENGTH'
!subTotalArray[1][4] = 'CODE'
!subTotalArray[1][5] = 'FAB'
!subTotalArray[1] = 'EREC'
!b = 2
DO !x from 1 to !boltArrayCompress.size()
IF (!boltArrayCompress[!x][1] EQ !subTotalArray[!subTotalArray.size()][1]) THEN
!subTotalArray[!subTotalArray.size()][5] = !subTotalArray[!subTotalArray.size()][5] + !boltArrayCompress[!x][5].real()
!subTotalArray[!subTotalArray.size()] = !subTotalArray[!subTotalArray.size()] + !boltArrayCompress[!x].real()
ELSE
!subTotalArray[!b][1] = !boltArrayCompress[!x][1]
!subTotalArray[!b][2] = !boltArrayCompress[!x][2]
!subTotalArray[!b][3] = !boltArrayCompress[!x][3]
!subTotalArray[!b][4] = !boltArrayCompress[!x][4]
!subTotalArray[!b][5] = !boltArrayCompress[!x][5].real()
!subTotalArray[!b] = !boltArrayCompress[!x].real()
!b = !b + 1
ENDIF
ENDDO
-- create output file and format into csv from array
!outputArray = ARRAY()
DO !x from 1 to !subTotalArray.size()
!lineArray = !subTotalArray[!x][1] + ',' + !subTotalArray[!x][2] + ',' + !subTotalArray[!x][3] + ',' + !subTotalArray[!x][4] + ',' + !subTotalArray[!x][5].string() + ',' + !subTotalArray[!x].string()
!outputArray.append(!lineArray)
ENDDO
!output1 = OBJECT FILE ('C:\TEMP\BOLT\BOLTOUTPUT1.CSV')
!output1.WriteFile('WRITE', !outputArray)
ENDFUNCTION