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
Thank you for your prompt response to my question.
I've created the following SUBROUTINE to test your solution.
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
You should use
ThisApplication.Settings(, "FeaturesManager").Set("cbSelected", False)
Yuri
Thank you for your contribution.
I've tried to implement your suggestion with
Public 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
The combination solution of
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 with
Is there a way to correct this routine?
I know that I can close the FEATURES MANAGER with something like
Public 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
Thanks for the INFO and the CODE.
I'll try out ASAP.
Thanks again.
-- Matt
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
-- Matt
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