How To Retrieve Field Text from Sketched Symbol

How To Retrieve Field Text from Sketched Symbol

Lauren_healey
Participant Participant
202 Views
1 Reply
Message 1 of 2

How To Retrieve Field Text from Sketched Symbol

Lauren_healey
Participant
Participant

I am writing a program in Excel to retrieve information from a drawing in Inventor. The code I have works to retrieve the property field, but I want to retrieve the value of the field text instead. 

0 Likes
Accepted solutions (1)
203 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor
Accepted solution

Hi @Lauren_healey.  You have to use the SketchedSymbol.GetResultText method.  That method wants you to specify the exact Inventor.TextBox object containing the 'prompted entry', then it returns its current 'result text'.  There is also the similar SketchedSymbol.SetPromptResultText, which works in a similar way.  You can find the right TextBox object by iterating through them, and checking their TextBox.Text property value, which will usually contain something like "<MyPromptName>".  Then capture that TextBox to a variable that was declared before the iteration of TextBoxes, so that you can use it after that block of code for the method, or just use that method within the loop, at the point where it is found.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)