Face used to create a plane

Face used to create a plane

Anonymous
Not applicable
433 Views
2 Replies
Message 1 of 3

Face used to create a plane

Anonymous
Not applicable

is it possiable to know a face is used to create a workplane. I am creating an addin to make workplanes on all 6 faces of a rectangular surfacebody (solid) in multibody part. I want to avoid creating plane on faces already used to create a workplane. I am looking something like below.

Dim oPart As PartDocument
    Set oPart = ThisApplication.ActiveDocument
    
    Dim oPartDef As PartComponentDefinition
    Set oPartDef = oPart.ComponentDefinition
    
    Dim oFace As face
    
    For Each oFace In oPartDef.SurfaceBodies.Item(1).Faces
        'Code to check any plane is created by
        'offset this face
    Next

 

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

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi saseendrankombath,

I think you're looking for the WorkPlane.DrivenBy property.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

Message 3 of 3

Anonymous
Not applicable
Accepted solution

Thanks Curtis, for the guidance

 

For Each oWorkPlane In oPartCompDef.WorkPlanes
                            If oWorkPlane.DrivenBy.Count <> 0 Then
                                If oWorkPlane.DrivenBy.Item(2) Is oFace Then
                                    Createplane = False
                                    PlaneCreated = False
                                End If
                            End If
                        Next
                        If Createplane = True Then
                            Set newPlane = oPartCompDef.WorkPlanes.AddByPlaneAndOffset(oFace, 0)
                            Set normal = GetNormal(newPlane)
                            PlaneCreated = True
                        End If
                    End If

 My Problem solved with the above code.

 

0 Likes