Need to retrieve Type data of custom iPropertis using iLogic

Need to retrieve Type data of custom iPropertis using iLogic

RoyWickrama_RWEI
Advisor Advisor
4,062 Views
23 Replies
Message 1 of 24

Need to retrieve Type data of custom iPropertis using iLogic

RoyWickrama_RWEI
Advisor
Advisor

I am developing part of my rule to handle custom iProperties.

I need to retrieve "Type" data of iProperties.

Today.pngMy 

My current rule (sample) is attached here to: I need to do with iProperty type information.

I appreciate if someone help me.

0 Likes
Accepted solutions (2)
4,063 Views
23 Replies
Replies (23)
Message 21 of 24

Michael_Riemer
Enthusiast
Enthusiast

If anyone still needs it here is my code to check the type of an iProperties value:

Dim activeDoc As Document = ThisApplication.ActiveDocument
Dim message As String
For Each iProp As Inventor.Property In activeDoc.PropertySets.Item("Inventor User Defined Properties")
	message &= vbNewLine & iProp.DisplayName & " is of Type " & iProp.Value.GetType().ToString()
Next
MessageBox.Show(message)

 

This will give the Type of each custom iProperty.

Message 22 of 24

ReneRepina
Collaborator
Collaborator

Sorry for really late reply!

 

@NachoShaw 

You are correct about adding as 123456 or "123456".

In our case, we know which types our properties have to be, but it sometimes happened that 123456 was added as the number instead of the string.

We could just convert as you suggested, but that would dirty files which have OK properties. We needed to check the type of the property, so if it is string, just skip it, if it is NOT string, convert it. I was missing this comparing piece, which we can get via "GetType()" as @Michael_Riemer suggested.

Thank you for the help anyway!

 

@Michael_Riemer 

Thank you for the suggested code and hint! We are gonna work around "GetType()".

0 Likes
Message 23 of 24

NachoShaw
Advisor
Advisor

Hey

 

I have a good function to check the type of a value, ill share it later tonight when I'm ar my desk

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 24 of 24

ReneRepina
Collaborator
Collaborator

Greetings @NachoShaw .

 

Great! Looking forward to it. Thank you.


0 Likes