custom properties

custom properties

tegstette
Advocate Advocate
429 Views
2 Replies
Message 1 of 3

custom properties

tegstette
Advocate
Advocate

I have an ilogic rule that lists all my custom properties - but it only lists the propertynames.

How can I get it to also show/add the value of the properties, something like this:

Propertyname = Propertyvalue

 

 

Dim oDoc As Document = ThisApplication.ActiveDocument
Dim Pros As New ArrayList
Dim item As String
	
		Dim oPropsets As PropertySets
		oPropsets = oDoc.PropertySets
		Dim oPropSet As PropertySet
		oPropSet = oPropsets.Item("Inventor User Defined Properties")
		Dim oPro As Inventor.Property
			For Each oPro In oPropSet
				Dim Found As Boolean = False
				For Each item In Pros
				If oPro.Name = item Then Found = True
			Next
		If Found = False Then
		Pros.Add(oPro.Name)
		End If
	
Next
Dim AllPros As String = "List of all used iProperties:"
	For Each item In Pros
	AllPros = AllPros & vbLf & item
	Next
MsgBox(AllPros)
Best regards
TG

Autodesk Inventor/Vault Professional 2021
0 Likes
Accepted solutions (1)
430 Views
2 Replies
Replies (2)
Message 2 of 3

Owner2229
Advisor
Advisor
Accepted solution

Hi, how about this:

 

'...
Pros.Add(oPro.Name & " - " & oPro.Expression)
'...

 

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
Message 3 of 3

tegstette
Advocate
Advocate

Perfect! Thank youSmiley Happy

Best regards
TG

Autodesk Inventor/Vault Professional 2021
0 Likes