Sketched Symbol with prompt text and ILogic

Sketched Symbol with prompt text and ILogic

Anonymous
Not applicable
1,231 Views
1 Reply
Message 1 of 2

Sketched Symbol with prompt text and ILogic

Anonymous
Not applicable

I have created a Sketched Symbol "Replace by" with a prompt text where I must write the new drawing number.

 

I'm trying to use Ilogic function to copy the Prompted text into a custom drawing iProperty.

 

Here is the code :

 

Format:HTML Format Version:1.0 StartHTML:     165 EndHTML:    3471 StartFragment:     314 EndFragment:    3439 StartSelection: 314 EndSelection:     314
SyntaxEditor Code Snippet

SubMain()oInvDoc=ThisApplication.ActiveDocument
ForEachoSymbolInoInvDoc.ActiveSheet.SketchedSymbols
IfoSymbol.Name="Replace by"TheniProperties.Value("Custom", "Replace by")=???????EndIfNext
End Sub

I work  with IV 2012

 

Tanks for the help

0 Likes
1,232 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

This is in C#, but I expect it would be very similar.  You need to use getResultText.

 

foreach (SketchedSymbol oSketch in inventorSheet.SketchedSymbols)
{
	Inventor.TextBox definitionText = oSketch.Definition.Sketch.TextBoxes[1];
	string temp = oSketch.GetResultText (definitionText);
}

 

definitionText just specifies what textbox you want to look at in the sketchedSymbol.  My symbol only has one field.  If yours has more, make sure you specify the correct one.  

 

I don't know if you've used C# before, but the equivalent of referencing TextBoxes[1] is somethign like TextBoxes.item[1]...It isn't exact, but it should be close enough to help.

 

0 Likes