I created a Revit plugin in C# that allow users totally new to 3D technology to choose a family, and insert it in their project. But right now the user does not have the choice between placing an object on the point anywhere or on a face. It's either one or the other. Right now my code looks like this :
bool useSimpleInsertionPoint = false; //or true
bool useFaceReference = true; //or false
if (useSimpleInsertionPoint)
{
//my code for insertion on point here
}
if (useFaceReference)
{
//my code for face insertion here
}
What I would like to do is ask the user what does he want to do. Does TaskDialog.Show would do the trick or is it something else ?
Thanks in advance.
Vincent's approach is good. The one thing that I like a little bit more is to use the CommandLink options with TaskDialog. This gives you the "big option" buttons to pick from, provides both an answer as well as an optional line of "explanation" about each answer.
The code looks like:
TaskDialog td = new TaskDialog("Decision");
td.MainContent = "What do you want to do?";
td.AddCommandLink(TaskDialogCommandLinkId.CommandLink1,
"Use Simple Insertion Point",
"This option works for free-floating items");
td.AddCommandLink(TaskDialogCommandLinkId.CommandLink2,
"Use Face Reference",
"Use this option to place the family on a wall or other surface");
switch (td.Show())
{
case TaskDialogResult.CommandLink1:
// do the simple stuff
break;
case TaskDialogResult.CommandLink2:
// do the face reference
break;
default:
// handle any other case.
break;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With