HVAC
Administrator Guide
DRAW Sketches
: HVAC Sketches Created in Batch
HVAC Sketches Created in Batch
The common object !!hvaSketch can be used in a macro to be run as a batch job:
-- Initialise variables
!allSpools = ARRAY()
!element = /myZone
-- Array of spools to process
var !allSpools collect all HSPOOL for $!element
!numberOfSpools = !allSpools.size()
-- Set the Global instance of the !!hvacSketch
!!hvacSketch.createIn
= object DBREF ('/MyRegistry')
!!hvacSketch.hvacSketchLogFile
= object FILE'%AVEVA_DESIGN_WORK%\myLog')
!!hvacSketch.selectedTemplate
= object DBREF ('/MyTemplateDrawing')
!!hvacSketch.hvacSpool
= object DBREF ('/MyHvacSpool')
WARNINGS OFF
-- Log progress - Put a start entry into the logfile
var !clock clock
!createIn = !!hvacSketch.createIn.name
!template = !!hvacSketch.selectedTemplate.name
!!hvacSketchesLog('HVAC Sketching Log')
!!hvacSketchesLog('=================================')
!!hvacSketchesLog(' ')
!!hvacSketchesLog('Starting the log file at $!clock')
!!hvacSketchesLog('Element to be processed = $!element')
!!hvacSketchesLog('Template being used for all drawings = $!template')
!!hvacSketchesLog('All drawings being created in registry = $!createIn')
!!hvacSketchesLog(' ')
-- Log progress
!!hvacSketchesLog('$!numberOfSpools drawings are to be created')
!!hvacSketchesLog('----------------------------------')
!!hvacSketchesLog(' ')
-- ************* HVAC Sketches Code... ***********************
-- Run drawing creation
do !i indices !allSpools
!spool = !allSpools[!i].dbref()
-- Log progress
prompt 'Generate HVAC Sketch $!i of $!numberOfSpools'
var !clock clock
!!hvacSketchesLog('Generating HVAC Sketch $!i of $!numberOfSpools for $!spool.fullName - $!clock')
-- ******** This is the command that does all the work ************
!!processhvacSketches(!spool)
-- Log progress
var !clock clock
!!hvacSketchesLog('*Completed HVAC Sketch $!i of $!numberOfSpools for $!spool.fullName - $!clock')
!!hvacSketchesLog(' ')
enddo
-- Log progress - Put an end entry into the logfile
var !clock clock
!!hvacSketchesLog('Ending the log file at $!clock')
-- Open the log file
!!hvacSketch.openLog()
-- Write to the log file
!!hvacSketch.writeLog()
-- Close the log file
!!hvacSketch.closeLog()
-- Empty the log data array
!!hvacSketch.emptyLogData()
WARNINGS ON
-- end of Macro
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.