New line in commandmanager.pick label

New line in commandmanager.pick label

youann21700
Advocate Advocate
221 Views
2 Replies
Message 1 of 3

New line in commandmanager.pick label

youann21700
Advocate
Advocate

Afternoon,

One of our tools is a probe that displays part properties. The code for it is shown below. 

Line 22 defines the probe label that shows when a part is selected. I would like each of the 5 properties to shown on their own line, rather than in 1 continuous line. I have tried vbCrLf with no luck. 

Any ideas?

TheStart :
On Error GoTo endof

Dim doc = ThisApplication.ActiveDocument
Dim entity = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Select a Part - or ESC to exit")

If (Not entity Is Nothing) Then
	oOne = "Part Number: " & iProperties.Value(entity.Name, "Project", "Part Number")
	oTwo = "Mass: " & Round(iProperties.MassOfComponent(entity.Name), 2) & " kg"
	oThree = "Material: " & iProperties.MaterialOfComponent(entity.Name)
	oFour = "Designer: " & iProperties.Value(entity.Name, "Project", "Designer")
	oFive = "Description: " & iProperties.Value(entity.Name, "Project", "Description")

	'--------------Show File Name in oFive if Description iProp is empty---------------
	If iProperties.Value(entity.Name, "Project", "Description") = "" Then : oFive = "Description: " & entity.Name : End If

Dim oSet1 As HighlightSet  ' Create a highlight set.
oSet1 = doc.CreateHighlightSet
oSet1.Color = ThisApplication.TransientObjects.CreateColor(255, 108, 180) ' Change the color
Call oSet1.AddItem(entity)

bob = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, (oOne & " - " & oTwo & " - " & oThree & " - " & oFour & " - " & oFive))
bob = ""
Call oSet1.Clear
End If

If (Not entity Is Nothing) Then  'Allow Escape to Exit 

	GoTo TheStart :
End If

Return
endof :

 

0 Likes
222 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor

Hi @youann21700.  Unfortunately, we seem to be constrained by the space and behavior of Inventor's user interface.  That 'prompt' will usually show not only next to our mouse pointer, but also within the status bar, when using the Pick method.  There is only so much room down there.  A assume that they (Autodesk) were thinking that if it allowed paragraphs there, it would get in the way.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

Michael.Navara
Advisor
Advisor

I'm afraid it is not possible. Few years ago I try to create similar tool but I can display only one line description this way.

This inconvenience is the reason why I publish this tool as SelectionInfo on my GitHub. You can download or fork them and modify for your needs.

 

0 Likes