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

Positionnumber on which sheet

GeorgK
Advisor

Positionnumber on which sheet

GeorgK
Advisor
Advisor

Hello together,

 

is there a possibility to a add a coloumn to the partlist for all position numbers and the corresponding sheetname?

 

Pos.Nr. 1 - Sheet2

Pos.Nr. 2 - Sheet1

Pos.Nr. 3 - Sheet1

Pos.Nr. 4 - Sheet3

 

Thank you

Georg

0 Likes
Reply
Accepted solutions (1)
646 Views
8 Replies
Replies (8)

Sergio.D.Suárez
Mentor
Mentor

Hi, I think that once I faced something similar, I have a drawing with many sheets, each sheet with different views of parts of an assembly. This rule creates a custom property in each part, which indicates the sheet in which it is located in the drawing.
I have simplified the rule so that it is easy to interpret.
You can modify the values to identify the drawing file

 

 

Dim oDoc As DrawingDocument = ThisDoc.Document
oSheets = oDoc.Sheets
myparam = InputBox("Defines the location location on a sheet", "Location on a sheet", "H")
For Each oSheet As Sheet In oDoc.Sheets
	For Each oView As DrawingView In oSheet.DrawingViews
	oViewModelDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
	oModelName = oView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
	Dim SheetNumber As String = Mid(oSheet.Name, InStr(1, oSheet.Name, ":") + 1)

	Dim customPropSet As PropertySet = oViewModelDoc.PropertySets.Item("Inventor User Defined Properties") 
    On Error Resume Next 
    customPropSet.Item(myparam).Value = SheetNumber
	    If Err.Number <> 0 Then 
	    	customPropSet.Add(SheetNumber, myparam) 
   		End If
	Next
Next

 I hope to be clear and that this will help solve your problem.


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes

GeorgK
Advisor
Advisor

Hello @Sergio.D.Suárez ,

 

thank you very much. I'll give it a try.

 

Georg

0 Likes

chandra.shekar.g
Autodesk Support
Autodesk Support

@GeorgK,

 

Can you please elaborate your requirement with examples? Make sure that files are non confidential.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes

bradeneuropeArthur
Mentor
Mentor

Hi,

 

This will guide you in the correct direction i think!

Public Sub main()

Dim a As Application
Set a = ThisApplication

Dim b As DrawingDocument
Set b = a.ActiveDocument


Dim c As Balloon
Set c = b.ActiveSheet.Balloons.Item(1)

Dim v As DrawingView
Set v = c.ParentView

MsgBox v.Parent.Name



End Sub

Please let me know if you need further assistance....

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

0 Likes

GeorgK
Advisor
Advisor

Hello @chandra.shekar.g ,

I would like to add a column with the sheet number in which the position number is placed.

Positionsnummer_Blatt.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Thank You

Georg

0 Likes

bradeneuropeArthur
Mentor
Mentor
Accepted solution
Public Sub main()

Dim a As Application
Set a = ThisApplication

Dim b As DrawingDocument
Set b = a.ActiveDocument


Dim c As Balloon

For Each c In b.ActiveSheet.Balloons
Dim v As DrawingView
Set v = c.ParentView

Dim p As PartsList
Set p = b.ActiveSheet.PartsLists.Item(1)

p.PartsListRows.Item(1).Item("Sheet").Value = v.Parent.Name
Next
'


End Sub

 

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

chandra.shekar.g
Autodesk Support
Autodesk Support

@GeorgK,

 

Work around from @bradeneuropeArthur seems to be fine.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



GeorgK
Advisor
Advisor

@bradeneuropeArthur 

Thank you very much.

 

Georg