I am working with MATLAB to start Visio 2010. Then I want to put some different Shapes in a new Document from my own Stencil. But how can I add my own Stencil to the new Visio file and how do I add some Shapes to the new Document?
12 次查看(过去 30 天)
显示 更早的评论
At the moment I only can start Visio 2010, I can make a new file, then I can save it. But I can not add the stencil from Matlab. I can add the Stencil to the general stencils in Visio without mablab, but maybe I can add it also from Mablab. I tried it with StencilPaths but it didnt work. Also I want to know how I can add new shapes to the document.
Here my first code:
visio = actxserver('Visio.Application');
%visio.ActiveDocument;
visio.Documents.Add('');
visio.Documents.Item(1).SaveAs([cd '\' 'Filename.vsd'])
I would be glad if someone can help me, or if someone can link me a site where I can find some hints to work from Matlab with Visio.
Cheers Max
0 个评论
回答(2 个)
Tom
2015-1-12
Hey Max,
I'm trying to do the same. I see that you wrote this about 2 years ago. Do you have any results yet?
Best regards,
Tom
0 个评论
Luis
2019-11-29
You can use the invoke() or get() functions to access the stencil. Here a little example on how to drop a circle shape:
appVisio = actxserver('Visio.Application');
appVisio.Visible =1;
doc = appVisio.Documents.Add("Basic Diagram.vst");
pagObj = doc.Pages.Item(1);
% invoke() and get() produce the same result in this case
% stnObj=invoke(appVisio,'Documents','Basic Shapes.vss');
stnObj=get(appVisio,'Documents','Basic Shapes.vss');
mast_circ = get(stnObj,'Masters','Circle');
pagObj.Drop(mast_circ, 5,5);
1 个评论
harika kurra
2020-5-29
Hello Luis
Can you tell me how to get the position coordinates of the circle drawn in Visio
Thanks in advance
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!