Message 1 of 2
Extract text from sketched symbol
Not applicable
10-09-2009
06:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am using Inventor 2008 and am trying to extract text from a sketched symbol. I have found the last Revision Block in the database using this code:
Dim oLastRevBox As SketchedSymbol
Dim oSketchedSymb As SketchedSymbol
lNumSymb = oSheet.SketchedSymbols.Count
For i = 1 To lNumSymb
Set oSketchedSymb = oSheet.SketchedSymbols.Item(i)
If oSketchedSymb.Definition.Name = "Rev Block" Then
dInsXPos = oSketchedSymb.Position.X 'find location for insertion of next rev. block
dYPos = oSketchedSymb.Position.Y
dInsYPos = dYPos - 0.254
Set oLastRevBox = oSketchedSymb 'get last rev. block
End If
If oSketchedSymb.Definition.Name = "Rev Block 2" Then
dInsXPos = oSketchedSymb.Position.X 'find location for insertion of next rev. block
dYPos = oSketchedSymb.Position.Y
dInsYPos = dYPos - 0.254 * 2
Set oLastRevBox = oSketchedSymb 'get last rev. block
End If
Next
Now that I have the last revision block, I want to extract the text from that sketched symbol:
If oLastRevBox.Definition.Name = "Rev Block" Then
'Get text from oLastRevBox
End If
If oLastRevBox.Definition.Name = "Rev Block 2" Then
'Get text from oLastRevBox
End If
The text field are called "Rev Level", "Rev Description", "Rev Date", "Rev By", and "Rev Approved". The fields are the same, but I have two different symbols and the formatting of the text is slightly different.
Thanks,
Tim
Dim oLastRevBox As SketchedSymbol
Dim oSketchedSymb As SketchedSymbol
lNumSymb = oSheet.SketchedSymbols.Count
For i = 1 To lNumSymb
Set oSketchedSymb = oSheet.SketchedSymbols.Item(i)
If oSketchedSymb.Definition.Name = "Rev Block" Then
dInsXPos = oSketchedSymb.Position.X 'find location for insertion of next rev. block
dYPos = oSketchedSymb.Position.Y
dInsYPos = dYPos - 0.254
Set oLastRevBox = oSketchedSymb 'get last rev. block
End If
If oSketchedSymb.Definition.Name = "Rev Block 2" Then
dInsXPos = oSketchedSymb.Position.X 'find location for insertion of next rev. block
dYPos = oSketchedSymb.Position.Y
dInsYPos = dYPos - 0.254 * 2
Set oLastRevBox = oSketchedSymb 'get last rev. block
End If
Next
Now that I have the last revision block, I want to extract the text from that sketched symbol:
If oLastRevBox.Definition.Name = "Rev Block" Then
'Get text from oLastRevBox
End If
If oLastRevBox.Definition.Name = "Rev Block 2" Then
'Get text from oLastRevBox
End If
The text field are called "Rev Level", "Rev Description", "Rev Date", "Rev By", and "Rev Approved". The fields are the same, but I have two different symbols and the formatting of the text is slightly different.
Thanks,
Tim