Hello,
I am new to Python programming. I am trying to open Visio diagram and drop a
shape programmatically along with some attributes that need to be set.
So far I have been successful in opening the file,
dropping the shape object.
Now, I have known properties in my application that I need to export it to
this dropped object.
Also when I pass the variable for a file name v1.Documents(variable).
it is not working. Why? Any one please let me know what I am doing wrong and
how this should be corrected.
Thanks in advance,
Here is my code:
vpath = os.environ.get('TEMP')
vfilename = os.path.join(vpath, ''mytemp.vst')
v1 = win32com.client.Dispatch("Visio.Application")
v1.visible =1
visfile = v1.Documents.Open(vfilename)
#self.objsSelected
fiobj = self.winparent.selected_object()
loid = id2loid(fiobj.id)
for vdoc in v1.Documents:
#print vdoc.name
#fyle_ext = vdocs[len(vdocs)-3:]
if vdoc.masters.count > 0:
shapes = vdoc.masters
if shapes.count > 0:
for shp in shapes:
usrsubtype = 'Rectangle'
if shp.name==usrsubtype:
pinX = 1.75
pinY = 9.25
#v1.ActivePage.Drop(shp.name, pinX, pinY)
#v1.ActivePage.Drop(v1.Documents(vdoc.name).Masters(shp.name), pinX, pinY)
#v1.ActivePage.Drop(v1.Documents(vdoc).Masters(usrsubtype), pinX, pinY)
#v1.ActivePage.Drop(vdoc.Masters(shp), pinX, pinY)
#v1.ActivePage.Drop(usrsubtype, pinX, pinY)
v1.ActivePage.Drop(v1.Documents("temp.vss").Masters(usrsubtype), pinX, pinY)
v1.ActivePage.PageSheet.Cells("Prop.obj").Formula = loid
#v1.ActiveWindow.selection.Item(1).Cells("Prop.loid").Formula = loid
#v1.ActiveWindow.selection.Item(1).Cells("Prop.NAME").Formula = fiobj.name
#print loid
Cheers,
Padmasani Sowmia
---------------------------------
Shape Yahoo! in your own image. Join our Network Research Panel today!
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32