Inventor Customization

Reply
Contributor
Fredalone
Posts: 16
Registered: ‎02-14-2012
Message 1 of 8 (323 Views)
Accepted Solution

Send Components part list To another program with SQL Crystal Database

323 Views, 7 Replies
03-21-2012 04:02 AM

Can someone tell me an code to make in VBA editor, that read my part list (code, quantity and designition), and appears like this:

Example: Part list contains 5 codes.

 

Read active idw.
Read code nº1 (msg with code+quantity+designition)
Read code nº2 (msg with code+quantity+designition)
Read code nº3 (msg with code+quantity+designition)
Read code nº4 (msg with code+quantity+designition)
Read code nº5 (msg with code+quantity+designition)

msg ("Finish")

Contributor
Fredalone
Posts: 16
Registered: ‎02-14-2012
Message 2 of 8 (303 Views)

Re: Send Components part list To another program with SQL Crystal Database

03-21-2012 07:58 AM in reply to: Fredalone

Help?
Its just MsgBox... dont need to connect to SQL database yet... I just want to know how I find each part of the list, 1 by 1... and in each one, appears an message saying the quantity, item number, designation or/and code .

 

Please, help :smileysad:

Valued Mentor
Mike.Wohletz
Posts: 375
Registered: ‎07-29-2008
Message 3 of 8 (287 Views)

Re: Send Components part list To another program with SQL Crystal Database

03-21-2012 06:48 PM in reply to: Fredalone

This method shows going through each row and getting the column with the heading caption. It is only going to work with the first parts list on the active sheet. 

 

     Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveDocument
        Dim oSheet As Sheet = oDrawDoc.ActiveSheet
        Dim oPartsList As PartsList = oSheet.PartsLists.Item(1)
        For Each oRow As PartsListRow In oPartsList.PartsListRows
            Dim RowArray(oPartsList.PartsListColumns.Count - 1) As String
            For I As Integer = 1 To oPartsList.PartsListColumns.Count
                RowArray(I - 1) = oPartsList.PartsListColumns.Item(I).Title & vbTab & oRow.Item(I).Value
            Next
            MsgBox(String.Join(vbLf, RowArray))

        Next

 

Contributor
Fredalone
Posts: 16
Registered: ‎02-14-2012
Message 4 of 8 (277 Views)

Re: Send Components part list To another program with SQL Crystal Database

03-22-2012 01:51 PM in reply to: Fredalone

not working in inventor 2012... -.-"

Valued Mentor
Mike.Wohletz
Posts: 375
Registered: ‎07-29-2008
Message 5 of 8 (273 Views)

Re: Send Components part list To another program with SQL Crystal Database

03-22-2012 02:05 PM in reply to: Fredalone

It works fine in Inv 2012, how are you trying to use it? What programming environment are you working in?

 

Contributor
Fredalone
Posts: 16
Registered: ‎02-14-2012
Message 6 of 8 (270 Views)

Re: Send Components part list To another program with SQL Crystal Database

03-22-2012 02:49 PM in reply to: Mike.Wohletz
Like this... works! in my default.ivb file!
Thanks anyway :smileywink: I will try to connect now to SQL Crystal database :smileywink:
[ NOTE: PORTUGAL WINS!
Sub Part_List()
Dim i As Integer
i = 1
 
MsgBox ("Iniciar Teste")
 
        
        Dim idwDoc As Inventor.DrawingDocument
        Set idwDoc = ThisApplication.ActiveDocument
        
        Dim oSheet As Sheet
        Set oSheet = idwDoc.ActiveSheet
        
        Dim oPartsList As PartsList
        Set oPartsList = oSheet.PartsLists.Item(1)
        
        For Each oRow In oPartsList.PartsListRows
                    
            For i = 1 To oPartsList.PartsListColumns.Count
                MsgBox (oPartsList.PartsListColumns.Item(i).Title & vbTab & oRow.Item(i).Value)
            Next
           
            MsgBox ("Terminou")
 
        Next oRow
        
End Sub
Member
d_great_ice
Posts: 3
Registered: ‎12-13-2012
Message 7 of 8 (168 Views)

Re: Send Components part list To another program with SQL Crystal Database

12-13-2012 01:47 AM in reply to: Fredalone

Dear,

 

 

Can help me, how to filtering a part list use view by assembly drawing, with VBA editor or iLOGic code.

there is no class system for filter in partlist class.

 

 

im use autodesk inventor 2010, and get install use ilogic add-ons 2010

 

i want to get automation system for my inventor design.

 

Thx.

 

Ihsan Surahman,

*Expert Elite*
Curtis_Waguespack
Posts: 2,772
Registered: ‎03-08-2006
Message 8 of 8 (146 Views)

Re: Send Components part list To another program with SQL Crystal Database

01-04-2013 10:47 AM in reply to: d_great_ice

Hi d_great_ice,

 

See this link:

http://forums.autodesk.com/t5/Autodesk-Inventor/filtering-partlist-use-filter-View/m-p/3746331#M4577...

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube