Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello. Newbie here. Using Inventor Pro 2019 with Visual Studio 2017. My script reads the content center child node levels and puts them in a LONG string; which is printed to a message box. Unfortunately because of the length of the string and no scroll bars, I can't see the bottom of the list. So I would like to pass the string to a secondary form that has a text box with scroll bars. I do not have enough experience with .net to get code snippets from the internet to work. Do you know how to do this?
Module code:
Imports System
Imports System.Type
Imports System.Activator
Imports System.Runtime.InteropServices
Imports Inventor
Module Module1
Sub Main()
Dim invApp As Inventor.Application = System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application")
Dim invDoc As Inventor.Document = invApp.ActiveDocument
'this gets all of the child nodes in the content center and puts them in a string list
For Each Node1 As ContentTreeViewNode In TopNode.ChildNodes
StrCCList &= Node1.DisplayName & vbNewLine
For Each Node2 As ContentTreeViewNode In TopNode.ChildNodes.Item(Node1.DisplayName).ChildNodes
StrCCList &= " " & " " & Node2.DisplayName & vbNewLine
For Each Node3 As ContentTreeViewNode In TopNode.ChildNodes.Item(Node1.DisplayName).ChildNodes.Item(Node2.DisplayName).ChildNodes
StrCCList &= " " & " " & " " & " " & Node3.DisplayName & vbNewLine
For Each Node4 As ContentTreeViewNode In TopNode.ChildNodes.Item(Node1.DisplayName).ChildNodes.Item(Node2.DisplayName).ChildNodes.Item(Node3.DisplayName).ChildNodes
StrCCList &= " " & " " & " " & " " & " " & " " & Node4.DisplayName & vbNewLine
Next
Next
Next
Next
'reads the string list of the content center nodes
'MsgBox(StrCCList)
Dim FamResults As New FamResults(StrCCList)
'FamResults.Activate()
'FamResults.Show()
'FamResults.TextBox1.Text = StrCCList
End Sub
End ModuleSecondary form code:
Public Class FamResults
Public Sub New(ByVal PropSetString)
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
'Dim TextOutput As String = sender
'Dim TextOutput As String = "Family Results popup dialog"
'MsgBox(TextOutput)
'TextBox1.Text = TextOutput
End Sub
Private Sub ExitButton_Click(sender As Object, e As EventArgs) Handles ExitButton.Click
Me.Close()
End Sub
End Class
Solved! Go to Solution.