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: 

Named faces in an Assembly with Assembly created fillets

3 REPLIES 3
Reply
Message 1 of 4
neodd70
431 Views, 3 Replies

Named faces in an Assembly with Assembly created fillets

I have written code that allows the user to select the face of a part within an assembly which then will name that face which is used later to constrain that same face to a plane in another assembly and the code works as expected. There are times however that a fillet is created on the parts in an assembly as an assembly feature, the base part is unchanged but in the assembly there is a fillet. When this fillet is created inventor creates new faces that are touching the edge the fillet was created from, I verified this by checking the Transient key of the selected face both before and after the Assembly feature Fillet is created and they are completely different. When this is done and then the user selects the face of a part that is part of that Assembly fillet feature to run my code against, my code crashes because the face that is selected is not the actual face of the part, the actual face can only be accessed if you edit the part in place within the assembly or open the part in a new window. This is counter productive of what I am trying to do. I have searched the internet as well as selecting the face and looking at the live API thru VBA to see if there is a way to grab the actual underlying face of the part by selecting the face so I can assign a name to said face but I have been unable to find anything on the subject. Does anyone know how to navigate down to the actual face of the part within the assembly. I have already tried creating a ProxyFace of the selected face but that doesn't work either. I know that I can go to the SurfaceBody.Faces and the face I want will be in there somewhere but how do I know which face in the SurfaceBody.Faces is the underlying face of the one selected by the user. Any help would be greatly appreciated.    

3 REPLIES 3
Message 2 of 4
johnster100
in reply to: neodd70

I have the same problem. Any help would be appreciated.

 

thanks,

John

Message 3 of 4
neodd70
in reply to: johnster100

@johnster100 After poking around a bit I found a Method of the Face object, Edge Object and Vertex Object called "GetSourceFace", "GetSourceEdge" and "GetSourceVertex". These Methods will get the underlying objects if there are any and if not return "Nothing". Once I added this to my code it stopped crashing. 

 Dim oSourceFace As Face = Nothing
Dim oFace As Face = Nothing
oSel = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Select the face of the part the hole pattern will be on")

oSourceFace = oSel.GetSourceFace

            If oSourceFace Is Nothing Then
                oFace = oSel.NativeObject
            Else
                oFace = oSourceFace
            End If

 

I'm just learning how to program so if my code doesn't follow convention I apologize. 

Message 4 of 4
johnster100
in reply to: neodd70

Hi,

thanks for the reply.

 

I can only get the 'GetSourceFace' method to work if I loop through all the faceproxies on the occurrence surface bodies and check them against the original faceproxy. I'll implement this in my code just now but I don't think it's really an ideal solution.

 

Ideally there would be a way to check if a faceproxy exists in the assembly and if not find where it has been used. But if this doesn't currently exist in the api then I shall use the workaround.

 

thanks again,

John

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report