Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to create a loop for inserting blocks from a WPF MODAL form.
But I'm not getting it with my code using PromptPointOptions, I have a Flash of the form every time I enter a point.
How can I fix my code?
Thanks
// This is the code that displays the modal form
public class Commands
{
[CommandMethod("ModalForm")]
public static void ModalForm()
{
var dialog = new WpfModalForm();
// carrega o formulario
var result = AcAp.ShowModalWindow(AcAp.MainWindow.Handle, dialog, false);
}
}
// This is the code for the button that asks you to select points
private void OkButtonName_Click(object sender, RoutedEventArgs e)
{
var ed = AcAp.DocumentManager.MdiActiveDocument.Editor;
var ppo = new PromptPointOptions("\nSpecify insertion point: ");
ppo.AllowNone = true; // allows a null value
while (true)
{
var ppr = ed.GetPoint(ppo);
if (ppr.Status == PromptStatus.OK)
{
ed.WriteMessage("\nInsert and process the block at the point: " + ppr.Value.ToString());
}
else
{
ed.WriteMessage("\nNo points specified, the form will be reopened");
break;
}
}
}
Solved! Go to Solution.