Map Display Name Content Center bv VBA

Map Display Name Content Center bv VBA

Majjek
Advocate Advocate
1,758 Views
18 Replies
Message 1 of 19

Map Display Name Content Center bv VBA

Majjek
Advocate
Advocate

Hi,

 

I want to add a few columns to all of my CC families and map these columns to different properties.

For that I use a script that loops all the CC nodes and finds all the families.

The adding of all the columns works, and also the mapping to all properties work except for one.

I can't seem to correctly map the Display Name..

 

When I lookup the mapping, with GetPropertyMap, of families which have the correct mapping , the PropertySetID is empty and PropertyIdentifier is 'Display Name'.

When I use these values in SetPropertyMap, at first it seems to work. When I go to the new column in the Family Editor it shows me that it's being mapped correctly.

But when I place a file from the CC, I get an error that the component can't be created.

This is because of the mapping, because when I remove the column, or do the mapping manually, it works.

 

The strange thing is when I automate the mapping, the mapping doesn't come up under the 'Parameter Mapping->Template Parameters' in the Family Properties window.

There it's empty.

 

Does anybody know which is causing this and how to correctly map a column to the Display Name?

 

Thanks in advance.

 

0 Likes
Accepted solutions (1)
1,759 Views
18 Replies
Replies (18)
Message 2 of 19

bradeneuropeArthur
Mentor
Mentor

Hi,

 

I have had the same issue here!

 

I have tried this:

oContentTableColumn.SetPropertyMap("Member", "Display Name")

Seems that it is not supported yet...

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

0 Likes
Message 3 of 19

Majjek
Advocate
Advocate

Hi Arthur,

 

Thanks for your response.

I also tried that and all possible variants to that Smiley Tongue.

I can't seem to get it to work..

0 Likes
Message 4 of 19

bradeneuropeArthur
Mentor
Mentor

Hi,

 

I also did, but with no result!

Maybe there is a solution we did not try....

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

0 Likes
Message 5 of 19

chandra.shekar.g
Autodesk Support
Autodesk Support

@Majjek,

 

Second parameter should not be string value. It can be long value to specify property identifier.

 

PropertyIdentifier Variant Input Variant that identifies a property. This can be a Long value that specifies the PropId of a property within the specified property set or the name of a property.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 6 of 19

bradeneuropeArthur
Mentor
Mentor

Hi @chandra.shekar.g ,

 

What should the "long" value be than?

 

Regards,

 

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

0 Likes
Message 7 of 19

chandra.shekar.g
Autodesk Support
Autodesk Support

@bradeneuropeArthur,

 

Tried below VBA code to get property set ID and property identifier.

 

Sub Family_Testing()
        ' Set a reference to the ContentCenter object.
    Dim oContentCenter As ContentCenter
    Set oContentCenter = ThisApplication.ContentCenter

    ' Get the content node (category) "Fasteners:Bolts:Hex Head"
    Dim oContentNode As ContentTreeViewNode
    Set oContentNode = oContentCenter.TreeViewTopNode.ChildNodes.Item("Fasteners").ChildNodes.Item("Bolts").ChildNodes.Item("Hex Head")

    ' Get the "ISO 4015" Family object.
    Dim oFamily As ContentFamily
    For Each oFamily In oContentNode.Families
        If oFamily.DisplayName = "ISO 4015" Then
            Exit For
        End If
    Next
    
    Dim oColumn As ContentTableColumn
    Set oColumn = oFamily.TableColumns.Item(2)
    
    Dim map As String
    Dim Id As String
    
    Call oColumn.GetPropertyMap(map, Id)
    
    Debug.Print "PropertySetId : " & map
    Debug.Print "PropertyIdentifier : " & Id
End Sub

On running above VBA code, below output is displayed.

PropertySetId : {32853F0F-3444-11d1-9E93-0060B03C1CA6}
PropertyIdentifier : 20

Results can be compared in the below help documentation link.

 

http://help.autodesk.com/view/INVNTOR/2020/ENU/?guid=GUID-57DC1957-248A-4162-B49C-F1F48DE6B3C8

 

It is belongs to  PropertySetId  as "Design Tracking Properties" and 20 as "kMaterialDesignTrackingProperties"

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 8 of 19

Majjek
Advocate
Advocate

Hi Chandra,

 

That's exactly what I did before.

Looking at the results you got, I think that you've looked up the mapping properties of the material column.

Then you get these results.

 

If you look up the mapping properties of a column which has been mapped to Member.DisplayName, then you will see that there is no PropertySetID and the PropertyIdentifier is Display Name.

I can't get a long out of it.

 

Can you reproduce this?

0 Likes
Message 9 of 19

chandra.shekar.g
Autodesk Support
Autodesk Support

@Majjek,

 

Can you please provide sample content center part family name which contains "Display Name" as property?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 10 of 19

Majjek
Advocate
Advocate

Hi Chandra,

 

As far as I can see, the standard Content Center Families (DIN, ISO etc.) don't have Display Name mapped.

I don't think you can edit those families, so you would have to copy a family to a Custom Content Center and then map a property to Display Name yourself.

0 Likes
Message 11 of 19

bradeneuropeArthur
Mentor
Mentor

But with the API?

Still not possible?

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

0 Likes
Message 12 of 19

Majjek
Advocate
Advocate

Not as far as I can see.

Everything I try leads to the same issue.

0 Likes
Message 13 of 19

jan_priban
Alumni
Alumni
Accepted solution

Hi,

 

because Member.DisplayName does not belong to any PropertySet, it is not possible to set mapping via API. 

 

Try to leverage FileName or PartNumber

 

RenameBrowserNodes.jpg

 

Regards

 

Jan Priban, Inventor Content Center team

 

 

0 Likes
Message 14 of 19

Majjek
Advocate
Advocate

Hi Jan,

 

Ok that's a clear answer, then I don't have to look any further.

0 Likes
Message 15 of 19

snappyjazz
Collaborator
Collaborator

Hi Majjek. I am new to ilogic/vb.net. Sorry this is unorthodox but, I am trying to do the exact same thing. Can you provide some guidance, perhaps share your code?

 

0 Likes
Message 16 of 19

Majjek
Advocate
Advocate

I will send you a PM.

0 Likes
Message 17 of 19

bradeneuropeArthur
Mentor
Mentor

Still no solution for this?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

0 Likes
Message 18 of 19

Majjek
Advocate
Advocate

Just checked it in IV2021 and the behavior is still the same.

Message 19 of 19

A.Acheson
Mentor
Mentor

@Majjek @bradeneuropeArthur 

Inventor 2020

I just checked the code I was running to see what would happen when you put "" in for the property ID and Member.DisplayName is not assigned to a column. Result is a "half baked pie"

It is assigned to the new column but not to the family template.

 

My thoughts are it is either assigned to filename or part number by default and only a manual change can correct the mapping. It looks like the Property ID does not exist as you have all ready found out through the checks above. 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan