For years we have been using a promted entry in our drawings for the sheet number. E001
We have also been changing the sheet name in the browser to match this. If the sheet number changes, we have to change both. Can the sheet name from the browser be used in the tile block? I couldn't seem to locate it under any of the properties.
Our ultimate goal is to use Ilogic to read and write the sheet numbers from a master Excel sheet. I haven't been able to find any reference to Ilogic working with prompted entries.
Currently we are using Inventor 2012
Thanks
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Hopefully I understood your post correctly,
What I do works very well, (Only just applied it, as I did the same as you.)
Set your drawing number to the "Drawing, PART NUMBER" It works like a charm, no more renaming of sheets etc.
Regards
Reg.
brian wrote:Our ultimate goal is to use Ilogic to read and write the sheet numbers from a master Excel sheet.
Find someone who has VB.Net experience to make use of the Inventor API and link it to an Access database or excel.
Hi brian,
Here is some code from another thread that might get you closer. This reads the sheet name from the browser, trims off the :#, and then writes it to a prompted entry field in the titleblock called <Sheet Name>.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim oDoc As DrawingDocument oDoc = ThisApplication.ActiveDocument Dim oTitleBlock As TitleBlock Dim oTextBox As TextBox Dim oSheet As Sheet Dim lPos As Long Dim sSheetName As String For Each oSheet In oDoc.Sheets oTitleBlock = oSheet.TitleBlock lPos = InStr(oSheet.Name, ":") sSheetName = Left(oSheet.Name, lPos - 1) For Each oTextBox In oTitleBlock.Definition.Sketch.TextBoxes If oTextBox.Text = "<Sheet Name>" Then Call oTitleBlock.SetPromptResultText(oTextBox, sSheetName) End If Next Next
We have iLogic filling in prompted entries in our title blocks on drawing creation. The AddTitleBlock method will fill in prompted entries when it places the block if you provide the entries in a string array.
If you are pulling from a database, you might want to change from using prompted entries to iProperties. We've stayed with prompted entries because these are things such as Finish and date that may need to be changed later.
Hi sbixler,
One thing to always be aware of concerning the use of prompted entry (and you're probably already aware of it already), is that information resides only in the titleblock instance. This can lead to major issues down the road, if there is a need to batch replace titleblocks, and it can negate the use of the Drawing Resource tool, which would otherwise make quick work of this.
Having said that, I know many companies use prompted entry with no concerns of replacing titleblocks in the future.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Yep, we've made that choice. For us, building one-of-a-kind, completely self-contained projects, once a project is closed nobody messes with drawings, so replacing title blocks is not going to happen.
Hi brian.
Here's an updated code snippet that is closer to what you're after. This looks at the prompted entry text and writes it to the Sheet name (rather than the other way around). It checks for a sheet without a titleblock (and just skips it if found), and it checks for an empty prompted entry field. If empty is asks the user to enter one.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oTitleBlock As TitleBlock
Dim oTextBox As TextBox
Dim oSheet As Sheet
Dim lPos As Long
Dim sSheetName As String
Dim sNewName As String
For Each oSheet In oDoc.Sheets
'check to see if the sheet has a titleblock instance
If oSheet.TitleBlock Is Nothing Then
'Do Nothing
Else
oTitleBlock = oSheet.TitleBlock
lPos = InStr(oSheet.Name, ":")
sSheetName = Left(oSheet.Name, lPos - 1)
For Each oTextBox In oTitleBlock.Definition.Sketch.TextBoxes
If oTextBox.Text = "<Sheet Name>" Then
'check to see if prompted entry is empty
If oTitleBlock.GetResultText(oTextBox) = "" then
'if prompted entry is empty, then query the user
sNewName = InputBox("Enter Sheet Name", "No Sheet Name Found in TitleBlock", sSheetName)
oTitleBlock.SetPromptResultText(oTextBox, sNewName)
oSheet.Name = oTitleBlock.GetResultText(oTextBox)
Else
oSheet.Name = oTitleBlock.GetResultText(oTextBox)
End if
End If
Next
End If
Next
The above code will work with one prompted entries, can two prompted entries be used to form a sheet name?