Can I set the PREMIER 9.1.4 + FEATURES MANAGER + SAVE + SELECTED FEATURES OPTION with CODE?
All --
I've been using the FEATURES MANAGER to SAVE and OPEN .ROI FILES that contain ROIS and MEASUREMENTS.
It looks like some problems can occur if the
PREMIER 9.1.4 + FEATURES MANAGER + SAVE + SELECTED FEATURES OPTION
gets turned ON.
Is there a way that I can make sure this option is OFF using CODE?
I've attempted to RECORD MACRO but this option does not seem to RECORD.
Thanks.
-- Matt
I've been using the FEATURES MANAGER to SAVE and OPEN .ROI FILES that contain ROIS and MEASUREMENTS.
It looks like some problems can occur if the
PREMIER 9.1.4 + FEATURES MANAGER + SAVE + SELECTED FEATURES OPTION
gets turned ON.
Is there a way that I can make sure this option is OFF using CODE?
I've attempted to RECORD MACRO but this option does not seem to RECORD.
Thanks.
-- Matt
0
Best Answers
-
Oh, sorry for confusion. 9.1.4 doesn't like optional parameters:
Public Sub XYZTurnOffSelected() ThisApplication.Settings("Application", "FeaturesManager").Set("cbSelected", False) End Sub
0 -
Matt, in your macro a new command is created and it doesn't know if the Features Manager is open or not. You need to use the command from the main command's collection. I've modified the macro:
Public Sub XYZTurnOffSelected2() Debug.Clear If ThisApplication.Commands("Select.FeaturesManager.FeaturesManager").Checked Then Debug.Print "FEATURES MANAGER IS OPEN" MsgBox "The FEATURES MANAGER is OPEN. Please TURN OFF the SAVE SELECTED FEATURES OPTION" Else Debug.Print "FEATURES MANAGER IS CLOSED" ThisApplication.Settings("Application", "FeaturesManager").Set("cbSelected", False) End If End Sub
0
Answers
-
Hi Matt,This option exposed as "Selected" in the Save command and holds an array of the selected features. So, you do not need to turn it off for the macros.If you need to turn it off in UI (Features manager should be closed) call: Application.Settings(, "FeaturesManager").Set("cbSelected", False)Thanks,Nikita.0
-
Nikita --
Thank you for your prompt response to my question.
I've created the following SUBROUTINE to test your solution.Public Sub TurnOffSelectedFeatureSaveWithinFeaturesManager() Application.Settings(, "FeaturesManager").Set("cbSelected", False) End Sub
When I run this SUBROUTINE, I get an error that says
"Expecting a valid data type (eg. Integer)."
at CHAR 28 within the line that starts APPLICATION.SETTINGS.
Since my EDITOR is not showing SETTINGS as a PROPERTY or METHOD for APPLICATION, can you help me resolve this please?
Thanks.
-- Matt
0 -
Matt,
You should use
ThisApplication.Settings(, "FeaturesManager").Set("cbSelected", False)
Yuri0 -
Yuri --
Thank you for your contribution.
I've tried to implement your suggestion withPublic Sub XYZTurnOffSelected() 'Application.Settings(, "FeaturesManager").Set("cbSelected", False) ThisApplication.Settings(, "FeaturesManager").Set("cbSelected", False) End Sub
I can LOAD the code but when I try to run the SUBROUTINE, I get an error that says
"Ambiguous match found."
This happens whether the FEATURES MANAGER is OPEN or CLOSED.
I thought that might be due to the LONG name I originally gave this routine but shortening the name did not resolve the issue.
Can you please direct me to the problem?
Thanks.
-- Matt
0 -
Nikita and Yuri --
The combination solution ofPublic Sub XYZTurnOffSelected() ThisApplication.Settings("Application", "FeaturesManager").Set("cbSelected", False) End Sub
works (when the FEATURES MANAGER is CLOSED).
Just an LEARNING OPPORTUNITY, I tried to make a version of the SUBROUTINE that would sense whether the FEATURES MANAGER is OPEN or CLOSED.
I was not successful withPublic Sub XYZTurnOffSelected2() Debug.Clear If ( _ Select.FeaturesManagerCommands.FeaturesManager(Nothing).CheckState = _ MediaCy.IQL.Application.McCommand.mcCheckState.Checked _ ) _ Then Debug.Print "FEATURES MANAGER IS OPEN" MsgBox "The FEATURES MANAGER is OPEN. Please TURN OFF the SAVE SELECTED FEATURES OPTION" Else Debug.Print "FEATURES MANAGER IS CLOSED" ThisApplication.Settings("Application", "FeaturesManager").Set("cbSelected", False) End If End Sub
Is there a way to correct this routine?
I know that I can close the FEATURES MANAGER with something likePublic Function NewMacro2() As SimpleScript NewMacro2 = New SimpleScript With Select.FeaturesManagerCommands.FeaturesManager(NewMacro2) .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Unchecked .Run() End With End Function
but I'm trying to learn the INS and OUTS of PROGRAMMING PREMIER.
Thanks.
-- Matt
0 -
Nikita --
Thanks for the INFO and the CODE.
I'll try out ASAP.
Thanks again.
-- Matt
0 -
Nikita and Yuri --
I have tried the CODE below and it is now a great example of how to handle these two aspects of programming PREMIER.
Thank you
-- MattPublic Sub XYZTurnOffSelected2() Debug.Clear If ThisApplication.Commands("Select.FeaturesManager.FeaturesManager").Checked Then Debug.Print "FEATURES MANAGER IS OPEN" MsgBox "The FEATURES MANAGER is OPEN. Please TURN OFF the SAVE SELECTED FEATURES OPTION" Else Debug.Print "FEATURES MANAGER IS CLOSED" ThisApplication.Settings("Application", "FeaturesManager").Set("cbSelected", False) End If End Sub
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions