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: 

Can iAssembly configuration list appear in an iLogic form?

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
JBerns
1037 Views, 7 Replies

Can iAssembly configuration list appear in an iLogic form?

A client was looking to develop a custom interface for documenting iAssemblies.

 

Would it be possible with iLogic to:

 

1. Show form.

2. User selects a Browse button to select iAssembly to document.

3. List all iAssembly configurations in the form.

4. User picks configuration.

5. Select OK to create base view, projected view, and Parts List.

 

This may require API.

 

I look forward to your replies.

 

 

Kind regards,

 

Jerry Berns

 

 iAssembly Configuration List in an iLogic Form.png

-----------------------------------------------------------------------------------------
CAD Administrator
Using Inventor 2022
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
7 REPLIES 7
Message 2 of 8
Vladimir.Ananyev
in reply to: JBerns

The iAssemblyFactory object provides access to the iAssembly table and all members.

iAssemblyFactory.TableRows.Count property specifies the number of items in the collection.

iAssemblyFactory.TableRows.item property returns iAssemblyTableRow object by index or by name.

iAssemblyTableRow.MemberName property returns desired Name for the given TableRow.

So you may extract all member names and populate any desired list in your interface


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 3 of 8
jamal
in reply to: Vladimir.Ananyev

I am not too advanced in the code writing.  I am trying to utilize the iAssemblyFactory object, but i seem to using it improperly.  Can anyone send pictures of this process?  Or a sample of code that would me understand how to use this?  Thanks.

Message 4 of 8
Vladimir.Ananyev
in reply to: jamal

The following iLogic rule works in the context of the drawing document.  It gets the reference to the assembly from the drawing view, then verify if it is  iAssembly Member or not.  Then the rule finds iAssemblyTableRow collection to get all member’s names.

'CreateMembersList rule in Drawing Document

'Active drawing sheet
Dim oSheet As Sheet = ThisDrawing.Document.ActiveSheet
'get the reference to the desired drawing view
Dim oView As DrawingView = oSheet.DrawingViews.Item(1)

' get the reference to the assembly doc 
Dim oAssyDoc as AssemblyDocument = oView _
      .ReferencedDocumentDescriptor.ReferencedDocument
'assembly definition
Dim oAsmCompDef As AssemblyComponentDefinition = oAssyDoc.ComponentDefinition

' Make sure we have an iAssembly member.
If oAsmCompDef.IsiAssemblyMember = False Then
    MessageBox.Show( "Chosen document is not an iAssembly Member.", _
        "Members",MessageBoxButtons.OK,MessageBoxIcon.Exclamation)
    Exit Sub
End If


Dim oFactory As iAssemblyFactory _
    = oAsmCompDef.iAssemblyMember.ParentFactory

Dim oTableRows As iAssemblyTableRows = oFactory.TableRows
Dim St As String = ""
For Each oRow As iAssemblyTableRow In oTableRows
  St = St & oRow.MemberName & vbNewLine
Next

MessageBox.Show( St,"Members List", _
    MessageBoxButtons.OK, MessageBoxIcon.Information)

 Drawing.png

Results:

MembersList.png

Factory.png

Hope this helps.


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 5 of 8
JBerns
in reply to: Vladimir.Ananyev

Thank you, Vladimir. This should help us to get started.

 

Kind regards,

 

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using Inventor 2022
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Message 6 of 8
jamal
in reply to: JBerns

yes, Thank you Vladimir.  I used the code and i did produce a list of my iAssembly member names.  What I would like to do is be able to select which member I want from a view.  With that list you allowed me to produce, can I write a code that selects a member from that list for my views in my detail drawing?  some would probably say, you can easily select the member from the base view and they will all update.  Unfortunately my drawngs consist of several different base views, and it becomes a difficult task to try and change each view individually.  Thank you.

Message 7 of 8
JBerns
in reply to: jamal

Vladimir,

 

Drop-down lists are usually associated with Multi-value parameters. Unfortunately, drawings do not have access to parameters to my knowledge.

 

How can a user may a selection from a Form drop-down list in the drawing environment?

 

 

Kind regards,

 

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using Inventor 2022
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Message 8 of 8
Vladimir.Ananyev
in reply to: JBerns

Have you ever consider using VB to develop complicated user interface to your rules?   You can develop your own form with any controls using VB Express (free tool), you may call this form and return results back to your rule.

Could you look at this post:

Use VB.NET dialog in iLogic

http://adndevblog.typepad.com/manufacturing/2013/06/use-vbnet-dialog-in-ilogic.html


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

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

Post to forums  

Autodesk Design & Make Report