Creating custom iProperties in all Parts of an assembly AND putting them together in one custom iProperty

Creating custom iProperties in all Parts of an assembly AND putting them together in one custom iProperty

stigler
Advocate Advocate
129 Views
2 Replies
Message 1 of 3

Creating custom iProperties in all Parts of an assembly AND putting them together in one custom iProperty

stigler
Advocate
Advocate

Hi!

 

I have an iLogic snippet, that works perfect for creating the user defined iProperties in all the components (parts and sub assemblies) of an assembly BUT when I want to put these iProperties together into one (divided by a ";") I have a problem!

 

Here is my snippet:

''' Regel zum Anlegen der Stücklisten iProperties in allen Bauteilen einer Baugruppe 


Dim doc As AssemblyDocument = ThisDoc.Document

For Each refDoc As Document In doc.AllReferencedDocuments
    Dim customPropertySet = refDoc.PropertySets.Item("Inventor User Defined Properties")
    
	'''Anlegen des iProperty "BEMERKUNG"
	
	Try
        Dim test = customPropertySet.Item("BEMERKUNG")
    Catch
        customPropertySet.Add("", "BEMERKUNG")
    End Try
	
	Try
        Dim test = customPropertySet.Item("BEMERKUNG_Z1")
    Catch
        customPropertySet.Add("", "BEMERKUNG_Z1")
    End Try
	
	Try
        Dim test = customPropertySet.Item("BEMERKUNG_Z2")
    Catch
        customPropertySet.Add("", "BEMERKUNG_Z2")
    End Try
	
	Try
        Dim test = customPropertySet.Item("BEMERKUNG_Z3")
    Catch
        customPropertySet.Add("", "BEMERKUNG_Z3")
    End Try
	
	Try
        Dim test = customPropertySet.Item("BEMERKUNG_Z4")
    Catch
        customPropertySet.Add("", "BEMERKUNG_Z4")
    End Try
		
 '''Rule to put these custom iProperties together into one called BEMERKUNG (devided by ";")
 
 
iProperties.Value("Custom", "BEMERKUNG") = iProperties.Value("Custom", "BEMERKUNG_Z1") & ";" & iProperties.Value("Custom", "BEMERKUNG_Z2") & ";" & iProperties.Value("Custom", "BEMERKUNG_Z3") & 
";" & iProperties.Value("Custom", "BEMERKUNG_Z4")


Next


What is wrong with my rule for the connection of the single iProperties - Bemerkung_Z1, ...?

 

Thank You for Your help!

0 Likes
130 Views
2 Replies
Replies (2)
Message 2 of 3

stigler
Advocate
Advocate

....other idea:

 

I tried to create an iLogic Rule just for connecting of these 4 parts of the iProperties "BEMERKUNG" into one (devided by a";") for ALL parts and subassemblies of an assembly - what is wrong?

LFCR = Chr(13) & Chr(10)

''' Regel zum Anlegen der Stücklisten iProperties in allen Bauteilen einer Baugruppe 


Dim doc As AssemblyDocument = ThisDoc.Document

For Each refDoc As Document In doc.AllReferencedDocuments
    Dim customPropertySet = refDoc.PropertySets.Item("Inventor User Defined Properties")
    
''' Definition von BEMERKUNG - das iPoperty für Bemerkung

PN01 = iProperties.Value("Custom", "BEMERKUNG")
iProperties.Value("Custom", "BEMERKUNG") = iProperties.Value("Custom", "BEMERKUNG_Z1") & ";" & iProperties.Value("Custom", "BEMERKUNG_Z2") & ";" & iProperties.Value("Custom", "BEMERKUNG_Z3") & 
";" & iProperties.Value("Custom", "BEMERKUNG_Z4")

PN02 = iProperties.Value("Custom", "BEMERKUNG")
iProperties.Value("Custom", "BEMERKUNG") = Replace(PN16, ";", LFCR)



Next

It seamed to be an easy rule - BUT I have troubles

 

Thank You for help!

0 Likes
Message 3 of 3

daltonNYAW9
Advocate
Advocate

try putting ".ToString" after all the property values

 

and add an "_" when continuing on the next line

0 Likes