Skip to content

Instantly share code, notes, and snippets.

@Surrogate-TM
Created February 9, 2022 21:57
Show Gist options
  • Save Surrogate-TM/eb94bafee8a645da4b93cbef5d1eebc8 to your computer and use it in GitHub Desktop.
Save Surrogate-TM/eb94bafee8a645da4b93cbef5d1eebc8 to your computer and use it in GitHub Desktop.
Python: ShapeTransform_Cells
import win32com.client as win32
vApp = win32.gencache.EnsureDispatch('Visio.Application')
vWin = vApp.ActiveWindow
shp = vWin.Selection.PrimaryItem
cp = shp.Name
print(cp)
shp.Cells('Width').FormulaU = '7 mm'
shp.Cells('Height').FormulaU = '40 mm'
shp.Cells('Angle').FormulaU = '0 deg'
shp.Cells('PinX').FormulaU = '60 mm'
shp.Cells('PinY').FormulaU = '60 mm'
shp.Cells('LocPinX').FormulaU = 'Width*0'
shp.Cells('LocPinY').FormulaU = 'Height*1'
shp.Cells('FlipX').FormulaU = 'True'
shp.Cells('FlipY').FormulaU = 'True'
shp.Cells('ResizeMode').FormulaU = '1'
@Y4cine
Copy link

Y4cine commented Feb 10, 2022

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment