I would like to have an iLogic rule that changes the active sheet name to the Models Part Number property.
I tried ActiveSheet.name = iProperties.Value("Project", "Part Number"), but
get an Error: Property 'Name' is 'ReadOnly'.
Any help would be greatly appreciated.
Thanks,
Solved! Go to Solution.
Solved by rjay75. Go to Solution.
Yes, if you have a revision table on the drawing it could be pulled from there. What column is the Revision number at in the table.
Change the line:
prtRev = modelDoc.PropertySets("Summary Information").Item("Revision Number").Value
With
prtRev = ""
If dwgSheet.RevisionTables.Count > 0 Then
If dwgSheet.RevisionTables(1).RevisionTableRows.Count > 0 Then
Dim rows As RevisionTableRows = dwgSheet.RevisionTables(1).RevisionTableRows
prtRev = rows(rows.Count)(1).Text 'Get the text of the first column of the last row
End If
End If
Sure, is there what is the text of the prompt. Is there more than one field. Like 1 of 2.
After the line:
sheetOf = String.Format(" Sheet {0}", sheetNames(prtNumber)(1))
Add:
If Not dwgSheet.TitleBlock Is Nothing Then tb = dwgSheet.TitleBlock If tb.Definition.Sketch.TextBoxes.Count > 0 Then For Each txtBox As TextBox In tb.Definition.Sketch.TextBoxes If txtBox.FormattedText.Contains("Sheet</Prompt>") Then tb.SetPromptResultText(txtBox, sheetNames(prtNumber)(1)) End If Next End If End If
As a test try setting it to:
If txtBox.FormattedText.Contains("Sheet #") Then
to see what happens.
Also noticed a trailing ')' in your string that shouldn't be there.
I really like this rule is save me a lot of time however i would like to replace the Revision Number with the description of the part ive messed with it a liltle bit but it keeps kicking out errors. thanks!
Dopey.... Just look further back in this thread. Rjay posted a bunch of variations including one with descriptions.
It works great for an assembly file but I can't get it to work on a part file?
Can post or attached what you changed? In the original rule there was nothing specific to assemblies so it should work for both.
Thanks