Get position in Simulink browser programmatically, where user has last clicked with mouse cursor, to add block
4 次查看(过去 30 天)
显示 更早的评论
Hi all,
if a usere uses copy&paste in Simulink the block is pasted on the position where last clicked inside Simulink browser.
I would like to get/read this information programmatically where user last clicked, so that I can add a block to this exact position.
I've tried to find infos with DAS.Studio (see below code snippet), but couldn't find anything.
Thanks in advance.
BR Thomas
% The following code is a way to access the tabs of the Simulink editor
aStudio = DAS.Studio; % Get a blank studio;
allStudios = aStudio.getAllStudios; %Find all the studios currently open
studios = allStudios{1}.getAllStudiosSortedByMostRecentlyActive;
curTabIdx = studios.getCurrentTab; % Get the index of the current SL editor tab
tab = studios.getComponentsByTab(curTabIdx); % Get current tab
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!