How to prompt user for spatial calibration
I am capturing 4 different images to the image strip. Then I manually lock the selected images so that they appear in the image frame. I would like to prompt a ipp user to select a spatial calibration from a list and apply it to each of the 4 images, but I have no experience with VB or writing and editing macros. The spatial calibration would be the same for each of the 4 images, but the spatial calibration might be different for each group of 4. I recorded a macro of the sequence that would work if I always used the same spatial calibration, but I can't figure out how to show the list of available spatial calibrations and allow the user to select one. Any help is appreciated
0
Best Answer
-
Hi Jeff,
This macro will show calibration dialog prompting to select calibration and then applies it to all selected in the Image strip images:Public Function CalibrateSelectedImages() As SimpleScript CalibrateSelectedImages = New SimpleScript With Application.Gadgets.SpatialCalibration(CalibrateSelectedImages) .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Checked .Interactive=True .Prompt="Please select calibration and click Ok" .InteractionPanel="SCalibration" .InteractionLocation=McCommand.InteractionPosition.OutsideLeft .FilterInput = False .Run() End With With Automate.ScriptingCommands.CodeCommand(CalibrateSelectedImages) If .Run() Then ' User Code Here For Each wnd As McWindow In ThisApplication.WindowsEx.SelectionManager.Items Dim im As McImage=wnd.Document.Data 'apply selected calibration If im IsNot Nothing Then im.SpatialCalibration=Mediacy.Addins.SCalibration.modGlobals.m_SCalib End If Next End If End With End Function
Regards,
Yuri0
Answers
I've seen other posts about problems associated with having a spatial calibration labeled as "non" which contains nothing. Could that be the reason for the error?
Here's how I added the code:
The error is related to a missiing reference or Import statement. When you record macro they are added automatically.
Try to record a new macro where you open a calibration dialog. It should all necessary references to the project.
Yuri
Yuri
Yuri
Imports MediaCy.Commands
you can disable it adding ' in front:'Imports MediaCy.Commands
Let me know if it helps,Yuri
Yuri