Hi all,
I'm creating a TaskDialog where the user needs to select one of the phases in the model but I don't know how many CommandLinkX I'll need as it will depend on how many phases the model already has. Is there a way to use a loop to add them? I've done some research but couldn't find anything related to it. Thank you.
Snippet of code below. Ideally I'd love to do something like CommandLink[i] in the loop. I also noticed that each CommandLinkX has an id number, CommandLink1 is 1001 and I'd love to take advantage of that but not sure how.
var phaseArray = doc.Phases;
var phaseNameDiag = new TaskDialog("Phase Selection");
phaseNameDiag.MainInstruction = "What phase is it?";
for ( var i = 0; i < phaseArray.Size; i++)
{
phaseNameDiag.AddCommandLink(TaskDialogCommandLinkId.CommandLink1, phaseArray.get_Item(i).Name);
}
Solved! Go to Solution.
Solved by Speed_CAD. Go to Solution.
Can't find what you're looking for? Ask the community or share your knowledge.