Author Topic: Showing the Field Dialog (and returning a field / string)  (Read 1195 times)

0 Members and 1 Guest are viewing this topic.

Chumplybum

  • Newt
  • Posts: 97
Showing the Field Dialog (and returning a field / string)
« on: February 15, 2012, 08:04:28 PM »
Hi

I looking for functionality similar to the linetypedialog / colordialog where the dialog is shown and properties assigned, but after an hour or so of search and trial and error, i can't seem to get anything to work for the field dialog. So far, the only place i've been close is to access the field dialog via the inplacetexteditor:

Code: [Select]
<CommandMethodAttribute("AA")> _
Public Shared Sub Test_Nothing

Dim tedit As Autodesk.AutoCAD.ApplicationServices.InplaceTextEditor = Autodesk.AutoCAD.ApplicationServices.InplaceTextEditor.Current
tedit.FieldDialog(Nothing)

End Sub

<CommandMethodAttribute("BB")> _
Public Shared Sub Test_New

Dim tedit As Autodesk.AutoCAD.ApplicationServices.InplaceTextEditor = Autodesk.AutoCAD.ApplicationServices.InplaceTextEditor.Current
tedit.FieldDialog(New AADS.Field())

End Sub

<CommandMethod("CC")> _
Public Shared Sub Test_Date

Dim DateField As New AADS.Field("%<\AcVar Date \f ""M/d/yy"">%")

Dim tedit As Autodesk.AutoCAD.ApplicationServices.InplaceTextEditor = Autodesk.AutoCAD.ApplicationServices.InplaceTextEditor.Current
tedit.FieldDialog(DateField)

End Sub

but all these return 'eInvalidInput'. Another option is to use sendstringtoexecute:

Code: [Select]
<CommandMethod("TEST1")> _
    Public Sub SendStringToExecuteTest()

Dim doc As Autodesk.AutoCAD.ApplicationServices.Document = Application.DocumentManager.MdiActiveDocument

        doc.SendStringToExecute("Field ", False, False, True)

    End Sub

... but this just shows the Field dialog and prompts to place the MText. This could work... place the text, select the last added object and get the info that way, but i see this as a bit of a hack.

Has anyone tried accessing the field dialog before? is it even possible, or is arx the only way to do this currently?


any help would be great!

Cheers, Mark