How to add a new part or assembly in ilogic form when I need it each time again

How to add a new part or assembly in ilogic form when I need it each time again

ikilic1461
Enthusiast Enthusiast
1,219 Views
4 Replies
Message 1 of 5

How to add a new part or assembly in ilogic form when I need it each time again

ikilic1461
Enthusiast
Enthusiast

As in the example below, I want to create a part or assembly with ilogic form and i want to  use it ,in the top assembly when I need each time (again and again maybe  with different sizes )

This is exactly what i need  where the link  below time 3.57

 https://www.youtube.com/watch?v=nd1CeuSMiC4 

 

Capture.JPG

0 Likes
1,220 Views
4 Replies
Replies (4)
Message 2 of 5

JamieVJohnson2
Collaborator
Collaborator

Being that you have a very ambiguous, large scope question, its no surprise your getting no responses.  So here is a response, good bad or indifferent.  To add a component to an assembly using iLogic code, you must:

get reference to the assembly:

dim asmDoc as AssemblyDocument = ThisApplication.ActiveDocument 

that assumes the necessary assembly is the active document you can also use ThisDocument (they mean the same thing).

Then get the assembly definition

dim asmCompDef as AssemblyComponentDefinition = asmDoc.ComponentDefinition

This is where the occurrences for the parts and sub assemblies are found, you could loop through the existing list by using asmCompDef.Occurrences.  Use that object to verify existing file modeling data, as well as add parts and sub assemblies.

dim compOccs as ComponentOccurrences = asmCompDef.Occurrences

And finally, add parts and sub assemblies using these commands

compOccs.Add

compOccs.AddByComponentDefinition

compOccs.AddCustomiPartMember

compOccs.AddiAssemblyMember

compOccs.AddiPartMember

compOccs.AddUsingiMates

compOccs.AddVirtual

compOccs.AddWithOptions

 

To know what these mean in detail, I suggest you crack open the API help documentation, and search the index for the above names.

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 3 of 5

ikilic1461
Enthusiast
Enthusiast

Dear JamieVJohnson2 ;

 

Thank you for your great attention to my question. I understood now , it is not easy to code it for me and I need to understand VBA codding firstly. 

0 Likes
Message 4 of 5

ikilic1461
Enthusiast
Enthusiast

Dear JamieVJohnson2;

 

Is that possible to share with me a simple example with that kind of rule? 

It is very important for me to create that kind of something. 

Thanks in advance. 

0 Likes