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
Solved! Go to Solution.
Solved by Vladimir.Ananyev. Go to Solution.
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
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.
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)
Results:
Hope this helps.
Thank you, Vladimir. This should help us to get started.
Kind regards,
Jerry
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.
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
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