- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Activate the Text Box Dialogue Box (In IDW environment)
Hi All,
I currently have some time on my hands so I'm tweaking my idw templates with everything useful I can think of. I use an ilogic form to enter titleblock values etc... and on this form I also have a few rules that print to PDF with the correct rev and so on. I also wanted one to place and edit drawing notes (I haven't decided between sketch symbols or general notes).
I understand how to place these, edit their components, delete them etc... using code but rather than adjusting the contents of the notes through the .formattedtext approach I would just like to fire up the dialogue box you get when you manually double-click on text in the IDW environment. Is this possible?
The notes I am looking to create might say anything and may have 10 numbered points etc...
This is where I got to with a sketch symbols version (below). It opens the symbol for editing and selects the textbox..
Dim oDoc As DrawingDocument
oDoc = ThisDoc.Document
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
Dim oSketch As SketchedSymbol
For Each oSketch In oSheet.SketchedSymbols
If Left(oSketch.Name, 5) = "Notes" Then
Dim oSketchSketch As Sketch
oSketch.Definition.Edit(oSketchSketch)
NotesText = oSketchSketch.TextBoxes.Item(1)
ThisApplication.CommandManager.DoSelect(NotesText)
oSketch.Definition.ExitEdit
Else ' Do nothing
End If
Next oSketch
Thanks for your help!
Glenn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I worked out the approach for a sketchsymbol using the control definitions as below:
Dim oDoc As DrawingDocument
oDoc = ThisDoc.Document
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
Dim oSketch As SketchedSymbol
For Each oSketch In oSheet.SketchedSymbols
If Left(oSketch.Name, 5) = "Notes" Then
Dim oSketchSketch As Sketch
oSketch.Definition.Edit(oSketchSketch)
NotesText = oSketchSketch.TextBoxes.Item(1)
ThisApplication.CommandManager.DoSelect(NotesText)
Dim cds As ControlDefinitions
cds = ThisApplication.CommandManager.ControlDefinitions
cds.Item(2637).Execute()
' For i = 1 To cds.Count
' If cds.Item(i).DisplayName = "Edit Text" Then
' MsgBox(i)
' cds.Item(i).Execute()
' End If
' Next i
oSketch.Definition.ExitEdit
Else ' Do nothing
End If
Next oSketchThis doesn't seem to work for general notes not inside a sketch... Can anyone explain this to me? Command 'DrawingGeneralNoteEditCtxCmd' does not seems to work?
Dim oDoc As DrawingDocument
oDoc = ThisDoc.Document
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
Dim oSketch As SketchedSymbol
Dim oNote As GeneralNote
oNote = oSheet.DrawingNotes.GeneralNotes.Item(1)
ThisApplication.CommandManager.DoSelect(oNote)
Dim cds As ControlDefinitions
cds = ThisApplication.CommandManager.ControlDefinitions
cds.Item(1130).Execute()