Parts list Title

Parts list Title

cbenner
Mentor Mentor
6,673 Views
32 Replies
Message 1 of 33

Parts list Title

cbenner
Mentor
Mentor

Is there a way to make an iproperty show up in the Title bar of a parts list?  I'd like the Part Number of each Sub-assembly to tbe listed at the top of the parts list for that Sub-assembly... and frankly, doing it manually is a PITA on large drawings.  It would so much easier to put it into the Parts List style and have it just read the iproperty.

 

TIA

0 Likes
Accepted solutions (3)
6,674 Views
32 Replies
Replies (32)
Message 2 of 33

Anonymous
Not applicable

Hi,

 

Please try the follow codes, you can change the view.caption to the full file name.

 

Sub test()
    Dim oDocument As AssemblyDocument
    Set oDocument = ThisApplication.ActiveDocument
   
    Dim oView As View
    Set oView = oDocument.Views(1)
   
    Dim sFullfileName As String
    sFullfileName = oDocument.FullDocumentName
   
    oView.Caption = sFullfileName
   
End Sub

 

Thanks

-Flora

0 Likes
Message 3 of 33

cbenner
Mentor
Mentor

Tried it... got this:

 

Rule Compile Errors in title, in xxxxxx.idw

Error on Line 3 : 'Let' and 'Set' assignment statements are no longer supported.
Error on Line 6 : 'Let' and 'Set' assignment statements are no longer supported.

0 Likes
Message 4 of 33

mcgyvr
Consultant
Consultant

Are you trying to use 1 idw file for multiple subassemblies (like 1 subassy drawing per sheet)?

Are these sub assemblies only for this particular product or are they used in multiple products?

 

I would handle what you want by putting a new section in your titleblock (like "View Part Number") that would pull the part number (or iprop of your choice) into it. I am not aware of a way (without coding) that would allow what you want.

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
0 Likes
Message 5 of 33

cbenner
Mentor
Mentor

I think there is some confusion.  I can already get the part number into my title block, that's no problem. 

 

I use one .idw file for a full project.  First few sheets are the entire assembly layout with notes and tie points etc.  The remaning sheets are line details for all of the piping systems, one sub-assembly per sheet.  Each sub-assembly has it's own part number.  This part number is already showing up in the title block for each sheet.

 

In the lower left corner I put a parts list for each sub-assembly.  The parts list title appears to be just a text string, and as of right now I have to manually enter the part number (same one that is in the titleblock).  I'd like to pull it if from the iprops like I do in the titleblock... but I am beginning to see this is not possible.

 

Consider this an item for the wish list!  🙂

0 Likes
Message 6 of 33

mcgyvr
Consultant
Consultant

So you already have the part number of the subassy on the sheet.. So now you just want to duplicate it again in the parts list title for no reason other than just to have it there too? For what other purpose? If a user of this IDW wants to know the part number of the subassy on this sheet then just look in the title block. 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
0 Likes
Message 7 of 33

SBix26
Consultant
Consultant

Is it possible that the code that FloraFang posted will do what you want?  Your response with the error codes refers to "Rule Compile Errors" which makes me think that you attempted this in iLogic.  I believe that this is just straight VBA (macro) code.  I'm no expert in either iLogic or VBA, so I may be completely wrong.  But perhaps VBA could get what you want.

 

The idea of packing a whole project into one .idw file sends shivers up my spine!

0 Likes
Message 8 of 33

cbenner
Mentor
Mentor
Accepted solution

Why does that frighten so many people?  We build skid mounted bleach manufacturing and handling equipment.  Our projects are usuall broken into (3) idw's.  One for the frame, one for an equipment layout, and the big one for overall layout of the system and pipe line details sheets.  Biggest one we've ever had is the one I am on now, 36 sheets and counting.  No problems managing all of that.  But then, unlike typical machine design, we don't have thousands of details of machined parts to deal with, just the pipelines.

 

BTW, code didn't work with VBA either, but that may be because I have no clue how to use it!  Smiley Very Happy

 

I'm taking an i-Logic class at AU, maybe I can get something there.

 

Thanks everyone, this was more of a curiosity that a show stopper.

 

0 Likes
Message 9 of 33

mcgyvr
Consultant
Consultant

The all-in-one IDW bothers anyone who has even had an IDW file go corrupt and then you lose everything.

It happens. 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
0 Likes
Message 10 of 33

Ruffy85
Collaborator
Collaborator
Accepted solution

hi @cbenner

 

Dont know if you already need this 🙂

 

Got the some requirement as you. So thats the code

 

This changes the Titlebar of a partlist to the value of the Title Iproperty

 

Sub changeTitle()
   
    ' Set a reference to the drawing document.
    ' This assumes a drawing document is active.
    Dim oDrawDoc As DrawingDocument
    Set oDrawDoc = ThisApplication.ActiveDocument
    
    ' Set a reference to the first parts list on the active sheet.
    ' This assumes that a parts list is on the active sheet.
    Dim oPartList As PartsList
    Set oPartList = oDrawDoc.ActiveSheet.PartsLists.Item(1)
    
    Dim oRef As AssemblyDocument
    Set oRef = oPartList.ReferencedDocumentDescriptor.ReferencedDocument
    
    Dim ProjectPropset As PropertySet
    Set ProjectPropset = oRef.PropertySets.Item(1)
    
    Dim TitleProp As Property
    Set TitleProp = ProjectPropset.Item(1)
    
    oPartList.Title = TitleProp.Value
    
End Sub
If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).
Message 11 of 33

Mark.Lancaster
Consultant
Consultant

@Ruffy85

 

Thanks for sharing some code with the community and hopefully someone will benefit from it down the road...

 

But did you realize this posting is 7 years old?  Hopefully @cbenner has his answer by now...  Smiley Very Happy

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

Message 13 of 33

Ruffy85
Collaborator
Collaborator

Yep i realized,

 

thats why i said i dont know if you still need it 🙂

 

Anyway i searched for the same problem and find this post, but no solution, thats why i have written the code by myself and ppublished it here, after. If someone searches again for this problem in 2024 😄

 

 

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).
Message 15 of 33

Curtis_Waguespack
Consultant
Consultant

@cbenner wrote:

@Ruffy85

 

That was mighty generous of you to share.  TX!


@ cbenner, I just marked Ruffy85's post a solution, feel free to unmark it if you see fit.

0 Likes
Message 17 of 33

Anonymous
Not applicable

Hello,

 

Expanding on the posted code from earlier, I would like to add a part number to part list titles as well.

 

In my particular case, I need to create IDWs that are as condensed as possible. To accomplish this, I sometimes need to show multiple configurations of iassemblies/iparts on one sheet. I agree it's less than ideal, but I don't make the rules 😄

 

So, I have re-worked the above code to iterate through each sheet and add a part number to each part list. I have two problems though:

-> using a for loop to step through each parts list in a sheet doesn't seem to work due to sheets not being containers(?).

-> I have verified that i'm accessing different parts lists, but I'm getting the same part number on all titles of all iparts and iassemblies. I think this is because iassemblies don't have individual iprops? or maybe this has something to do with the way part lists reference parts?

 

Help appreciated.

image.png

 

 

 

Sub Main()

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

Dim oSheet As Sheet
For Each oSheet In oDrawDoc.Sheets

	Dim oPartList1 As PartsList
	Dim oPartList2 As PartsList
	Dim oPartList3 As PartsList
	
	Try
		oPartList1 = oSheet.PartsLists.Item(1)
		oRef = oPartList1.ReferencedDocumentDescriptor.ReferencedDocument
		oPartNo = oRef.PropertySets.Item("Design Tracking Properties").Item("Description").Value
		oPartList1.Title = "PARTS LIST - " & oPartNo
	Catch
	End Try
	
	Try
		oPartList2 = oSheet.PartsLists.Item(2)
		oRef = oPartList2.ReferencedDocumentDescriptor.ReferencedDocument
		oPartNo = oRef.PropertySets.Item("Design Tracking Properties").Item("Description").Value
		oPartList2.Title = "PARTS LIST - " & oPartNo
	Catch
	End Try
	
	Try
		oPartList3 = oSheet.PartsLists.Item(3)
		oRef = oPartList3.ReferencedDocumentDescriptor.ReferencedDocument
		oPartNo = oRef.PropertySets.Item("Design Tracking Properties").Item("Description").Value
		oPartList3.Title = "PARTS LIST - " & oPartNo
	Catch
	End Try

Next

End Sub

'Sub SetTitle(oPartList As PartsList)
'
'	oRef = oPartList.ReferencedDocumentDescriptor.ReferencedDocument
'	oPartNo = oRef.PropertySets.Item("Design Tracking Properties").Item("Description").Value
'	oPartList.Title = "PARTS LIST1 - " & oPartNo
'	
'End Sub

 

Message 18 of 33

Ruffy85
Collaborator
Collaborator

Hi @Anonymous

 

i cant realy follow you. What you trying to do?

 

You have multiple Sheets and on each Sheet you use Configurations of Ipart? And your Title should be follow your Ipart Iprops?

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).
0 Likes
Message 19 of 33

Anonymous
Not applicable

Yep, that's the basic idea. Some sheets are standard assemblies or parts though. So I'm trying to handle those as well. 

0 Likes
Message 20 of 33

Ruffy85
Collaborator
Collaborator

I don´t know how you doing this, more configurations of the same part on one drawing. and thats nota good idea i think 🙂

 

So i think i can´t help you

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).
0 Likes