Activate the Text Box Dialogue Box (In IDW environment)

Activate the Text Box Dialogue Box (In IDW environment)

gcoombridge
Advisor Advisor
559 Views
1 Reply
Message 1 of 2

Activate the Text Box Dialogue Box (In IDW environment)

gcoombridge
Advisor
Advisor

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

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
0 Likes
560 Views
1 Reply
Reply (1)
Message 2 of 2

gcoombridge
Advisor
Advisor

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 oSketch

 This 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()
	

  

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
0 Likes