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 个)

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by