5. Cable-Matrix Preparation
Supported for nettoolkit version >= 1.5.0
5.1. Provide Necessary Input Parameters for cable matrix
First define a few static inputs. Modify as actual.
CLEAN_FILES_LIST = [ # Provide All devices -clean excel files in a list (with full path)
'file1-clean.xlsx',
'file2-clean.xlsx',
'file3-clean.xlsx',
'file4-clean.xlsx',
'file5-clean.xlsx',
# ... add all those need in drawing
]
5.2. Generate cable-matrix Excel file
Lets import necessary packages first. Followed by some steps to generate excel.
# --------------------------------------------
# IMPORTS
# --------------------------------------------
from nettoolkit.pyVig import CableMatrix
import nettoolkit.nettoolkit_db as nt
# --------------------------------------------
# create DataFrame Generateion Object, and run
# --------------------------------------------
CM = CableMatrix(CLEAN_FILES_LIST)
CM.run()
# ----------------------------------------------------------------------------------
# arrange cabling tab in appropriate order [optional]
# change keep_all_cols=True ( if want a few additional informations )
# ----------------------------------------------------------------------------------
CM.arrange_cablings(keep_all_cols=False)
# ----------------------------------------------------------------------------------
# write data to Excel
# ----------------------------------------------------------------------------------
CABLE_MATRIX_OP_FILE = 'cable-matrix.xlsx' # output Excel file with full path
nt.write_to_xl(CABLE_MATRIX_OP_FILE, CM.df_dict, index=False, overwrite=True)
At this point a new Cable Matrix Excel file will be generated.