Can iAssembly configuration list appear in an iLogic form?

Can iAssembly configuration list appear in an iLogic form?

JBerns
Advisor Advisor
1,248 Views
7 Replies
Message 1 of 8

Can iAssembly configuration list appear in an iLogic form?

JBerns
Advisor
Advisor

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 AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
0 Likes
Accepted solutions (1)
1,249 Views
7 Replies
Replies (7)
Message 2 of 8

Vladimir.Ananyev
Alumni
Alumni

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

0 Likes
Message 3 of 8

jamal
Explorer
Explorer

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.

0 Likes
Message 4 of 8

Vladimir.Ananyev
Alumni
Alumni
Accepted solution

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

0 Likes
Message 5 of 8

JBerns
Advisor
Advisor

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

 

Kind regards,

 

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
0 Likes
Message 6 of 8

jamal
Explorer
Explorer

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.

0 Likes
Message 7 of 8

JBerns
Advisor
Advisor

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 AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
0 Likes
Message 8 of 8

Vladimir.Ananyev
Alumni
Alumni

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

0 Likes