Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Face used to create a plane

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
saseendrankombath
338 Views, 2 Replies

Face used to create a plane

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

 

2 REPLIES 2
Message 2 of 3

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

Message 3 of 3

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.

 

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

Post to forums  

Autodesk Design & Make Report