Chapter-2- Visio automation with Python-Code
Chapter-2 In chapter-1 we discussed on the relevant audience and available solution for Visio design, in this chapter we will see some code and it's output. Please don't get upset if below code doesn't work on your system. I would request you to keep your patience and continue your reading and you will learn how to make below code work. Example-1.0 from hld_exp import Visio visio = Visio () app = visio . open ( 'Visio' ) doc = visio . documents ( 'Basic Diagram.vst' ) stn = visio . stencils ( 'HP Devices updated.vssx' ) mstobj = visio . mastobj ( 'HP 5900 AF' ) page = visio . selectpage ( 1 ) coresw1 = visio . drawobject ( mstobj , 4.0 , 6.0 ) coresw2 = visio . drawobject ( mstobj , 8.0 , 6.0 ) active = visio . activedocument ().Masters( 1 ).Name contool1 = visio . connect () connect1 = page .Drop( contool1 , 0 , 0 ) connect2 = page .Drop( contool1 , 0 , 0 ) connect1 .Cells( 'BeginX' ).GlueTo( coresw1 .Cells( 'PinX...