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: 

ilogic to trigger and insert custom content center files to an assembly

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Carthik_Babu
3979 Views, 8 Replies

ilogic to trigger and insert custom content center files to an assembly

Hi,

I would like to know, whether is there is any ilogic option by which the Custom content center is triggered automatically to insert component in an assembly.

 

Thanks in advance.

Carthik

Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/
8 REPLIES 8
Message 2 of 9
Carthik_Babu
in reply to: Carthik_Babu

Hi, 

Below image shows the process sequence, the way i want to handle in ilogic.

 

content centre trigger option.png

I need the 3rd step to be triggered directly after "selecting the tree by ilogic code", so that selection can be made by user.

Whether it is possible.

 

I have modified the code from Inventor Help file as below

Sub Main()
PlaceContentCenterPart()
End Sub

Sub PlaceContentCenterPart()

' Set a reference to the active assembly document.
Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

' Set a reference to the ContentCenter object.
Dim oContentCenter As ContentCenter
oContentCenter = ThisApplication.ContentCenter

' Get the content node (category) "Fasteners:Bolts:Hex Head"
Dim oContentNode As ContentTreeViewNode
oContentNode = oContentCenter.TreeViewTopNode.ChildNodes.Item("Fasteners").ChildNodes.Item("Bolts").ChildNodes.Item("Hex Head")

' Get the "ISO 4015" Family object.
Dim oFamily As ContentFamily
For Each oFamily In oContentNode.Families
If oFamily.DisplayName = "ISO 4015" Then
Exit For
End If
Next

' Create a member based on the first row of the family.
Dim Error1 As MemberManagerErrorsEnum
Dim strContentPartFileName As String
Dim strErrorMessage As String
strContentPartFileName = oFamily.CreateMember(1, Error1, strErrorMessage)

' Dim oMat As Matrix
' oMat = ThisApplication.TransientGeometry.CreateMatrix

' Insert an instance of the content center member in the assembly.
'Call oDoc.ComponentDefinition.Occurrences.Add(strContentPartFileName, oMat)
' Set a reference to the transient geometry object.
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry

' Create a matrix.
Dim oMatrix As Matrix
oMatrix = oTG.CreateMatrix

'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence

'place an instance of the component
'
in this case at 0,0,0
'
positioned at the co-ordinates
oMatrix.SetTranslation(oTG.CreateVector(0, 0, 0))

oOccurrence = oAsmCompDef.Occurrences.Add(strContentPartFileName, oMatrix)
oOccurrence.Grounded = False
End Sub

Note: Autodesk Inventor Version :2011

 

Regards,

Carthik

 

 

Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/
Message 3 of 9
Carthik_Babu
in reply to: Carthik_Babu

oops....no reply yet.....well....is it possible to trigger "Change Size Option for a particular component" by Ilogic. 

Content Center Change Size Trigger.jpg

Kindly help, need this option badly to reduce my work in Design automation.

Regards,

Carthik Babu M.S

Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/
Message 4 of 9

Hi Carthikm,

 

I do not see any event for Change Size with iLogic, either does Inventor API. Although UserInputEvents.OnActivateCommand of  Inventor API can fire for Change Size, but it does not tell the Change Size command is executed

 

Probably AssemblyEvents.OnOccurrenceChange of Inventor API could help a bit. i.e. when the event fires, check if it is for the CC part you want to watch. 

 

 

Message 5 of 9

Thanks for your valuable reply. Well, then i have to drop my plan in handling content center by ilogic.......since i dont want to complicate much by moving to API. I made a different strategy to do my task. Thanks for the reply
Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/
Message 6 of 9
Carthik_Babu
in reply to: Carthik_Babu

Greeting to all,
Here is an example file to handle content center by Ilogic.
http://grabcad.com/library/ilogic-content-center-1
(Note: The file size is big, so i have not posted the file in this forum)
Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/
Message 7 of 9
Carthik_Babu
in reply to: Carthik_Babu

Just Attaching image for to show, "the way the content center file is inserted"

Ilogic-content center - Copy.jpg

Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/
Message 8 of 9
Carthik_Babu
in reply to: Carthik_Babu

For example, kindly check the link below.

http://forums.autodesk.com/t5/Autodesk-Inventor/Changing-C-C-component-Automation/td-p/2736623/page/...

Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/
Message 9 of 9

good day sir,

 

have you might find a way to program this? (change size in ilogic to change more than only the lenght)

or doesn't inventor have this option jet?

 

thanks in advance, 

Davey

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

Post to forums  

Autodesk Design & Make Report