Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

sheet name as part number

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
jostroopers
1725 Views, 9 Replies

sheet name as part number

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.

Mvg Jos
Youre drawings are as good as the symbols that compleet them.....
9 REPLIES 9
Message 2 of 10
yannick3
in reply to: jostroopers

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

Yannick Verreault
INV PRO 2015
MS Office 2007
Win 7 pro, core i7 950, asus P6T WS
nvidia Gforce GTX 295
WD caviar black 500Go
WD caviar black 1To

Message 3 of 10
jostroopers
in reply to: yannick3

is the ActiveSheet.Name the sheet name in the Browser?

because nothing is happening.

Mvg Jos
Youre drawings are as good as the symbols that compleet them.....
Message 4 of 10
yannick3
in reply to: jostroopers

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 

Yannick Verreault
INV PRO 2015
MS Office 2007
Win 7 pro, core i7 950, asus P6T WS
nvidia Gforce GTX 295
WD caviar black 500Go
WD caviar black 1To

Message 5 of 10
yannick3
in reply to: jostroopers

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 Verreault
INV PRO 2015
MS Office 2007
Win 7 pro, core i7 950, asus P6T WS
nvidia Gforce GTX 295
WD caviar black 500Go
WD caviar black 1To

Message 6 of 10
jostroopers
in reply to: yannick3

Yannick, thanks very much.

The code works just fine.

Mvg Jos
Youre drawings are as good as the symbols that compleet them.....
Message 7 of 10
jezavala
in reply to: yannick3

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?

 

Message 8 of 10
mrattray
in reply to: jezavala

Can you post the whole rule? The iLogic editor is famous for reporting the incorrect line number.
Mike (not Matt) Rattray

Message 9 of 10
jezavala
in reply to: mrattray

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

Message 10 of 10
jezavala
in reply to: jezavala

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?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report