In search of EnglishOptionValue

Is there a way to access the selected English Option Value?

GetString getString = new GetString();
getString.AddOption(*EnglishOption*, *EnglishOptionValue*);

I can:

var aa = getString.Option().LocalName;
var bb = getString.Option().EnglishName;
var cc = getString.Option().StringOptionValue;//Null
var i = getString.Option().CurrentListOptionIndex;

But I do not see:

var ee = getString.Option().EnglishOptionValue;
var ff = getString.Option().LocalOptionValue:



Moved to Scripting category

Hi @slyon,

Why do you need these? What are you trying to do?

– Dale


Just trying to use it as a way to set a Layer Name. I can do it a different way but this is a straight forward way of getting a valid Layer name from a simple get operation. Most classes I have worked with have carried this stuff through but there are lots of ways around this. I just wanted to make sure I was not missing anything before I implement.

public void SetLayout(
ref AsaPageView asaPageView,
double PageWidth,
double PageHeight
GetString getString = new GetString();
getString.AddOption(“Default”, “Project Name”);
getString.AddOption(“Standard”, “Project Name1”);
getString.SetCommandPrompt(“Do you want to add a layout for your stuff (enter to bypass)”);
if (getString.CommandResult() == Result.Cancel) return;
if (getString.CommandResult() != Result.Success) return;

        ***string stringOutput = getString.Option().EnglishOptionValue;***

        if (string.IsNullOrEmpty(stringOutput))
            //User only has one option. If this was an option list we would need to go another route
            stringOutput = _ProjectName;

        //Id nothing is selected exit
        if (string.IsNullOrEmpty(stringOutput)) {return;}

        if (stringOutput != null)
                //Return either an excising Layout or create a new one.
                RhinoPageView newPageView = 
                    ?? asaPageView.CreatePageView(stringOutput, PageWidth, PageHeight);

                if (newPageView == null)
                    RhinoApp.WriteLine("Layout could not be created.");
                    _doc.Views.ActiveView= newPageView;