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?
조회 수: 4 (최근 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
참고 항목
카테고리
Help Center 및 File Exchange에서 Database Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!