Ilogic How to get a custom Property from ASSY to all Children parts

Ilogic How to get a custom Property from ASSY to all Children parts

j.romo
Advocate Advocate
723 Views
2 Replies
Message 1 of 3

Ilogic How to get a custom Property from ASSY to all Children parts

j.romo
Advocate
Advocate

Hello Guys, here I am once again asking for some Knowledge.

Im automating some information from our Design department to the machinning departament in our shop.

Right now I want custom property as a date in the main assemblie named "Delivery Date", this Date is the goal time to finish the project, I am trying to Get this custom property to be inserted in all the assemby components (parts and sub assemblies). 

Thanks in advance

 

0 Likes
Accepted solutions (1)
724 Views
2 Replies
Replies (2)
Message 2 of 3

dgreatice
Collaborator
Collaborator
Accepted solution

 

Dim oApp As Application
Dim oAD As AssemblyDocument
Dim oACD As AssemblyComponentDefinition
Dim oSub As Document
Dim oMainPropSet As PropertySet
Dim oSubPropSet As PropertySet
Dim oMainProp As [Property]
Dim oSubProp As [Property]
Dim MyDate As Date
MyDate = "7/15/2018"

oApp = ThisApplication
oAD = oApp.ActiveDocument
oACD = oAD.ComponentDefinition
oMainPropSet = oAD.PropertySets.Item("User Defined Properties")
oMainProp = oMainPropSet.Item("Delivery Date")
oMainProp.Value = MyDate

For Each oSub In oAD.AllReferencedDocuments
    oSubPropSet = oSub.PropertySets.Item("User Defined Properties")
    On Error Resume Next
    oSubProp = oSubPropSet.Item("Delivery Date")
    
    If Err.Number <> 0 Then
        Call oSubPropSet.Add(MyDate, "Delivery Date")
    Else
        oSubProp.Value = MyDate
    End If
Next
Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
Message 3 of 3

j.romo
Advocate
Advocate

Thanks a lot worked like a charm....

0 Likes