Community
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Derived part and assembly (Copy i-Properties)

Derived part and assembly (Copy i-Properties)

Hi,

 

I would suggest the following to be implemented in inventor:

 

There should be a possibility to copy also the i-properties form the base model deriving from.

I already have made an add-in for this but I would like to have this implemented in inventor.

 

At this moment there is only a possibility to derive parameters, but no i-propeties.

 

Regards

 

 

6 Comments
kennyj
Collaborator

I was just going to post this idea, when I found this post.

 

Can you share your Rule/Code to accomplish this?

 

Thank you,

 

Kenny

kennyj
Collaborator

For others who were looking for a rule or work-around.  (Thank you to the Inventor Customization Forum for helping me put this together):

 

'-----Start iLogic Rule "Copy all Custom iProperties from original derive"

'Find derived parts in open document
Dim oDerived As Inventor.Document = ThisApplication.ActiveDocument

'If no derived parts, exit rule
If oDerived.ReferencedDocuments.Count = 0 Then Exit Sub

'Set derive count to One, if more than One pick first instance
Dim oReferenced As Inventor.Document = oDerived.ReferencedDocuments(1)

'copy Derived properties
Dim oDerProps As PropertySet = oDerived.PropertySets.Item("Inventor User Defined Properties")

'copy set from above into new set in current file
Dim oRefProps As PropertySet = oReferenced.PropertySets.Item("Inventor User Defined Properties")


'From list set above, create array of named properties ("*" will copy all, replace with )
Dim oProList() As String = {"*", "OTHER_iPRO"}
For Each oRefPro As Inventor.Property In oRefProps
   
    'Check for existing, add if not existing
    Dim oSkip As Boolean = True
    For Each ProName As String In oProList
        'Ucase ignores upper/lower case in names
        If Ucase(ProName) <> Ucase(oRefPro.Name) And ProName <> "*" Then Continue For
        oSkip = False
        Exit For


'Copy from derived properties to current properties
    Next
    If oSkip Then Continue For
    Dim oDerPro As Inventor.Property
    Try
        oDerPro = oDerProps(oRefPro.Name)
    Catch
        oDerPro = oDerProps.Add("", oRefPro.Name)
    End Try
    oDerPro.Value = oRefPro.Value
Next


'-----End iLogic Rule

This is also very important. We need it.

RKF
Explorer
Explorer

Hi,

I need to create Custom iProperty in Part consisting of "Part Number" iProperty of derived Part. I don't know how to retrieve that in iLogic code.

any help will be appreciated,

Regards,

sei.bun
Enthusiast

@kennyj  Thank you!

Could you open a new topic for this.

Than I can share the code!

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea  

Technology Administrators


Autodesk Design & Make Report