Assembly of sub assembly and assembly occurrence using face naming

Assembly of sub assembly and assembly occurrence using face naming

nishantkumat5921
Enthusiast Enthusiast
482 Views
4 Replies
Message 1 of 5

Assembly of sub assembly and assembly occurrence using face naming

nishantkumat5921
Enthusiast
Enthusiast

Hi,

 

I am trying to assemble a sub assembly with with the assembly occurrence using face naming concept.

The face name is taken from a part of sub assembly. I am getting an unspecified error when creating the mate. 

I have check both of my face names are taken.

 

Below is a reference code attached.

 

Thanks in advance.

 

 

 

 

if (HFWNSP_C.ReferencedDocumentDescriptor.ReferencedDocumentType == DocumentTypeEnum.kAssemblyDocumentObject)
                {
                    AssemblyDocument CurrPartd = (AssemblyDocument)HFWNSP_C.ReferencedDocumentDescriptor.ReferencedDocument;
                    for (int i = 1; i < CurrPartd.ComponentDefinition.Occurrences.Count; i++)
                    {
                        if (CurrPartd.ComponentDefinition.Occurrences[i]._DisplayName == "HFWNSP_C_bkhs")

                        {
                            PartDocument RefDoc = (PartDocument)CurrPartd.ComponentDefinition.Occurrences[i].Definition.Document;
                            ComponentOccurrence currCompOcc = CurrPartd.ComponentDefinition.Occurrences[i];
                            RefDoc = (PartDocument)currCompOcc.ReferencedDocumentDescriptor.ReferencedDocument;
                            Obj = RefDoc.AttributeManager.FindObjects("iLogicEntityNameSet", "iLogicEntityName", "Face1");
                            oFace1 = (Face)Obj[1];
                            currCompOcc.CreateGeometryProxy(oFace1, out FaceObj1);
                            break;
                        }
                    }
                    
                }
                else
                {
                    
                }
                if (occ5.ReferencedDocumentDescriptor.ReferencedDocumentType == DocumentTypeEnum.kAssemblyDocumentObject)
                {
                }
                else
                {
                    PartDocument prtDoc = (PartDocument)occ5.ReferencedDocumentDescriptor.ReferencedDocument;

                    Obj = prtDoc.AttributeManager.FindObjects("iLogicEntityNameSet", "iLogicEntityName", "Face1");
                    oFace2 = (Face)Obj[1];
                    occ5.CreateGeometryProxy(oFace2, out FaceObj2);
                }
                oAsmCompDef.Constraints.AddMateConstraint(FaceObj1, FaceObj2, 0);

 

 

@chandra.shekar.g

 

0 Likes
483 Views
4 Replies
Replies (4)
Message 2 of 5

bradeneuropeArthur
Mentor
Mentor

I also searched for a solution in VB.net, I did not find it yet.

In Ilogic this is all easy possible, but I also need in Vb.net.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 5

nishantkumat5921
Enthusiast
Enthusiast

@bradeneuropeArthur thanks for the reply. Is it possible for you to share the Ilogic code? . I could probably try to find solution from that.

0 Likes
Message 4 of 5

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Here you can find it:

https://knowledge.autodesk.com/support/inventor/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/Inve...

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 5 of 5

nishantkumat5921
Enthusiast
Enthusiast

@bradeneuropeArthur 

The given link contains both components as parts but in my scenario let grip side A be an .IAM and grip side B as an .IPT inside the .IAM and grip side C .IPT as an occurrence of main assembly. 

 

One face is inside grip side B .IPT and other face in grip side C.IPT. From the above code I was able to get the faces but during constraint creation got an unspecified error.

 

I hope this explains my scenario without confusions.

0 Likes