- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is there a Easy way to Text box that always writt the part number of the file?
Is there a Easy way to Text box that always writt the part number of the file? I would like that if I make a part with an laser cut text, then if I copy it later and create a new file.. the new file will have the new part number lasercut into the part. ? what is the easy way to do that `?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
For a begining here is a code that changes a text box.. text. Asuming the text box is alone in the sketch and the said sketch is the second one of the part :
Dim doc As Inventor.PartDocument = ThisApplication.ActiveDocument
Dim pcd As Inventor.PartComponentDefinition = doc.ComponentDefinition
Dim sk As Inventor.PlanarSketch = pcd.Sketches.Item(2)
Dim txtbox As Inventor.TextBox = sk.TextBoxes.Item(1)
Dim newText As String = "Testing"
Dim actualText As String = txtbox.Text
Dim fText As String = txtbox.FormattedText
sk.Edit
txtbox.FormattedText = fText.Replace(actualText, newText)
sk.ExitEdit
For the automation I would probably put the rule on the Open Document trigger. It would read the iProperty and put the value instead of the newText string. I guess you could accomplish that ?
Kind regards,
FINET L.
Kind regards,
FINET L.
If this post solved your question, please kindly mark it as "Solution"
If this post helped out in any way to solve your question, please drop a "Like"