I have a following question.
I want to use the part number propertie to change the sheet name in the .idw
So when i insert a new sheet and place a part the part number wil be placed in the title block and i want to shange the sheet name to that part number.
Solved! Go to Solution.
Solved by yannick3. Go to Solution.
Hi
that's very simple , use ilogic, add external rule and set the trigger before save the file. you can add this rule directly in the drawing too but the best is external rule
Here is the simple rule
iProperties.Value("Project", "Part Number")=ActiveSheet.Name
is the ActiveSheet.Name the sheet name in the Browser?
because nothing is happening.
Yes it's the sheet name in the browser
here it's work well. Have you save your file before run the rule?
Sorry i check in wrong place in the browser, yes you're right
Hi
i find on the net this rule that you can use
Dim oSheets As Sheets
oSheets = ThisDoc.Document.sheets
Dim oSheet As Sheet
For Each oSheet In oSheets
oSheet.activate
Dim oDrawingView As DrawingView
oDrawingView = oSheet.DrawingViews(1)
oModelName = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
oDesc = iProperties.Value(oModelName, "Project", "Part Number")
oSheet.Name = oDesc
Next
Yannick, thanks very much.
The code works just fine.
Sorry for asking but I need this code too, and I´m trying to use this code in ilogic inventor 2013 but it sends me an error message:
Error on Line 16 : End of statement expected.
My line 16 says:
oModelName = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
How can I solve this error?
Dim oSheets As Sheets
oSheets = ThisDoc.Document.sheets
Dim oSheet As Sheet
For Each oSheet In oSheets
oSheet.activate
Dim oDrawingView As DrawingView
oDrawingView = oSheet.DrawingViews(1)
oModelName = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
Try
oDesc = iProperties.Value(oModelName, "Project", "Part Number")
oSheet.Name = oDesc
End Try
Next
I also tried this code:
Dim oSheets As Sheets
oSheets = ThisDoc.Document.sheets
Dim oSheet As Sheet
For Each oSheet In oSheets
oSheet.activate
Dim oDrawingView As DrawingView
oDrawingView = oSheet.DrawingViews(1)
oModelName = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
oDesc = iProperties.Value(oModelName, "Project", "Part Number")
oSheet.Name = oDesc
Next
'end of ilogic code
But still having the same error, now in line 9, can you help me please?