|
| 1 | +import sys |
| 2 | +import clr |
| 3 | +# Add Assemblies for AutoCAD |
| 4 | +clr.AddReference('AcMgd') |
| 5 | +clr.AddReference('AcCoreMgd') |
| 6 | +clr.AddReference('AcDbMgd') |
| 7 | +clr.AddReference('AdWindows') |
| 8 | + |
| 9 | +# Import references from AutoCAD |
| 10 | +from Autodesk.AutoCAD.Runtime import * |
| 11 | +from Autodesk.AutoCAD.ApplicationServices import * |
| 12 | +from Autodesk.AutoCAD.EditorInput import * |
| 13 | +from Autodesk.Windows import * |
| 14 | + |
| 15 | + |
| 16 | +adoc = Application.DocumentManager.MdiActiveDocument |
| 17 | +ed = adoc.Editor |
| 18 | + |
| 19 | +td = TaskDialog() |
| 20 | +td.WindowTitle = "The title" |
| 21 | +td.MainInstruction = "Something has happened." |
| 22 | +td.ContentText = "Here's some text, with a " + "<A HREF=\"http://adn.autodesk.com\">" + "link to the ADN site</A>" |
| 23 | +td.VerificationText = "Verification text" |
| 24 | +td.FooterText = "The footer with a "+ "<A HREF=\"http://blogs.autodesk.com/through" + "-the-interface\">link to Kean's blog</A>" |
| 25 | +td.EnableHyperlinks = True |
| 26 | +td.EnableVerificationHandler = True |
| 27 | + |
| 28 | +td.CollapsedControlText = "This control can be collapsed." |
| 29 | +td.ExpandedText = "This control can be expanded..." + "\nto multiple lines." |
| 30 | +td.ExpandFooterArea = True |
| 31 | +td.ExpandedByDefault = False |
| 32 | + |
| 33 | +td.MainIcon = TaskDialogIcon.Shield |
| 34 | +td.FooterIcon = TaskDialogIcon.Information |
| 35 | + |
| 36 | +td.UseCommandLinks = True |
| 37 | +td.Buttons.Add(TaskDialogButton(1, "This is one course of action.")) |
| 38 | +td.Buttons.Add(TaskDialogButton(2, "This is another course of action.")) |
| 39 | +td.Buttons.Add(TaskDialogButton(3, "And would you believe we have a third!")) |
| 40 | +td.DefaultButton = 3 |
| 41 | + |
| 42 | +td.RadioButtons.Add(TaskDialogButton(4, "Yes")) |
| 43 | +td.RadioButtons.Add(TaskDialogButton(5, "No")) |
| 44 | +td.RadioButtons.Add(TaskDialogButton(6, "Maybe")) |
| 45 | + |
| 46 | +td.DefaultRadioButton = 5 |
| 47 | +td.AllowDialogCancellation = False |
| 48 | + |
| 49 | +"Need help with the Callback here" |
| 50 | + |
| 51 | +td.Show(Application.MainWindow.Handle) |
0 commit comments