Check if Part is a mirrored part

Check if Part is a mirrored part

wolfgang_nickl
Advocate Advocate
780 Views
3 Replies
Message 1 of 4

Check if Part is a mirrored part

wolfgang_nickl
Advocate
Advocate

Hello together,

I looked for a way to check if a Part is a mirrored part. I didn't find a solution here, but after some tests I found a way that works for me. Perhaps someone needs this too.  The following VBA sub shows it. When you mirror parts in Inventor the first DirevedPartComponet has a Property mirror.  A derived component where you select the option mirror while you create it has it too, But in this case it could also be the second or other DirevedPartComponent.

Sub subWNtestMirrorpart()
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    Dim isMirror As Boolean
    On Error Resume Next
    isMirror = oDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.Item(1).Definition.Mirror
    On Error GoTo 0
    If isMirror Then
        MsgBox "mirrored part"
    Else
        MsgBox "Not mirrored part"
    End If
End Sub

Best Regards

Wolfgang

781 Views
3 Replies
Replies (3)
Message 2 of 4

MatthiasMinich
Participant
Participant

works great.

 

Thanks

0 Likes
Message 3 of 4

checkcheck_master
Advocate
Advocate

@wolfgang_nickl 

Handy.
I'm trying to get it to iLogic but it doesn't really work.
I can't see .Mirror in iLogic
Tips?

0 Likes
Message 4 of 4

FRFR1426
Collaborator
Collaborator

You need to cast the definition to DerivedPartUniformScaleDef.

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes