Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Automatically naming sheets in a * .idw file.

farmerstain
Participant

Automatically naming sheets in a * .idw file.

farmerstain
Participant
Participant

Hello.
I would ask for information if Inventor 2015 is able to automatically assign names of Sheets in the * idw file as one of the iProperties parameters from the 3d model of the * .iam or * .ipt file?
I will be grateful for any help.
Sincerely
Wojciech Janko

0 Likes
Reply
Accepted solutions (1)
616 Views
6 Replies
Replies (6)

clutsa
Collaborator
Collaborator

Yes you can... Can you please give an example of what you're trying to do so we can give you a relevant example

If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates

farmerstain
Participant
Participant

Hello.
I would need to automatically name Sheets.
I have a * .idw document file, which has about 100 sheets, on each sheet there will be a single part (* .ipt) or assembly (* .iam).
I would like the name of the sheet to be automatically changed from "Sheet" to the string which was entered in iProperties -> "Project" -> "Version number".
for examples: "Sheet" -> "2.1.1.3.5"
I would be extremely grateful for your help, because manually naming each sheet is quite laborious and you can be mistaken.
Greetings.
Wojtek

0 Likes

clutsa
Collaborator
Collaborator

It would look something like this.

Dim app As Application = ThisApplication
Dim doc As DrawingDocument = app.ActiveDocument
Dim oSheet As Sheet
Dim oView As DrawingView 
Dim docM As Document
For Each oSheet In doc.Sheets
	oView = oSheet.DrawingViews(1)
	docM = oView.ReferencedDocumentDescriptor.ReferencedDocument
	oSheet.Name = docM.PropertySets.Item("Design Tracking Properties").Item("Part Property Revision Id").Value 'I couldn't find "Version Number" in "Project" but I'm in 2018
	'oSheet.Name = docM.PropertySets.Item("User Defined Properties").Item("Version Number").Value 'This would be for a custom property
Next
If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates

farmerstain
Participant
Participant

Hello.
Thank you for the program, but it does not end up changing the name to "Revision Number".
In the drawing I have marked what needs to be copied and where to insert.
I just wanted to point out that "iProperties" are from the 3D model and the sheet name is in the * .idw document file.
I would be grateful for your help in solving this problem.
Sincerely
Wojtek

0 Likes

clutsa
Collaborator
Collaborator
Accepted solution

Try this for Revision Number...

Dim app As Application = ThisApplication
Dim doc As DrawingDocument = app.ActiveDocument
Dim oSheet As Sheet
Dim oView As DrawingView 
Dim docM As Document
For Each oSheet In doc.Sheets
	oView = oSheet.DrawingViews(1)
	docM = oView.ReferencedDocumentDescriptor.ReferencedDocument
	oSheet.Name = "words to prepend here" & docM.PropertySets.Item("Inventor Summary Information").Item("Revision Number").Value & "words to apend here"
Next

 Sorry I don't see a marked up drawing... screen shots might help me understand what you want better. I was under the impression you would want the iProperty from the model because it went with the only part on that sheet. 

If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates

farmerstain
Participant
Participant

Hello.
Thank you very much for your help, the formula works perfectly :slightly_smiling_face:
You are great :slightly_smiling_face:
Thank you again and best regards :slightly_smiling_face:

0 Likes