BrainStorm ideas for table Creation

BrainStorm ideas for table Creation

Anonymous
Not applicable
778 Views
6 Replies
Message 1 of 7

BrainStorm ideas for table Creation

Anonymous
Not applicable

Greetings,

Currently, I am the only one in my office who has any knowledge about Inventor, so I am going to reach out to this group for some ideas to help develop a solution.

 

Currently my needs are to have an adjustable table that changes in number of rows with a fixed number of columns.   Every design we create will have a different possible number of coils.  From 1 to 100.

 

However, I would like this to be driven with ilogic, which I can do.  The problem I am having is creating an adjustable table that can be generated based off of the number of coils needed.  The only way I can find is to edit the table and hide visibility of each row;  not effecient.  

 

Currently I am trying a part that is only a table.  However, have not found a way to visibly hide lines that do not need to be seen.

 

Other options I have tried is to use ilogic to build the table, however, I can only do one row at a time, and then you would have to line up each coil appropriatly; not efficient.

 

Third option was to use ipart and pull that info by the coil used, again you would have to line up each row.  So... the hunt continues for the best solution.  

Open to any ideas that this community might have.

 

 

Thanks for your time.

 

Inventor 2016

Windows 7 Professional

0 Likes
Accepted solutions (1)
779 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
Hi,

Mabey this is a part of my code could help you.
Basicly it imports the contents of your excel in a 2D array.
Only thing that you have to keep in mind using this method that it iterates through every row.
If there is a blank space in your first column the code stops.

I also use another part of code to import all values in my first row.
This row i use as a "title" row. When i look up a value in the matrix i use the value in the title row to determine the correct column.
This way i can move columns around without adjusting the code because it searches the title instead of a pre defined column number.


'Declare all variables Dim Matrix ( 0 To 52, 0 To 1000 ) As String Dim Temp As ArrayList Dim ColumnStart As String Dim ColumnEnd As String Dim RowNumber As Integer 'Open and import all excel information for pump selection GoExcel.Open("Pump generator 1.1.xlsx", "Pump_Selection") Temp = GoExcel.CellValues("Pump generator 1.1.xlsx", "Pump_Selection", "A1", "") RowNumber = Temp.Count For i = 0 To RowNumber ColumnStart = "A" & i + 1 ColumnEnd = "AZ" & i + 1 Temp = GoExcel.CellValues("Pump generator 1.1.xlsx", "Pump_Selection", ColumnStart, ColumnEnd) For j = 0 To 53 Try Matrix(j,i) = Temp(j) Catch Continue For End Try Next Next
Message 3 of 7

Anonymous
Not applicable
BasPeeters,
Thanks for the idea, I will definitely give it a try and see how that works.
0 Likes
Message 4 of 7

Anonymous
Not applicable

ok, well, I think I have everthing I need to make this adjustable table work.  It will involve a lot of ilogic programming, but thats ok.

 

However, there is one last piece I would like to receive some help with.

The attached part file is working just how I want.  When you change the evapnumber the table adjusts and the appropriate sketches visibility are turned on and off.

 

However, when that part is updated.  The drawing does not update the visibility of the sketches.  Not sure why?  Any ideas? 

 

0 Likes
Message 5 of 7

Anonymous
Not applicable

Well, did some research created different view representations for  each row of the table as desired.  Yet... same result.  

Applying the view representations to the view did not hide the sketches that I need hidden.

 

Attached are the updated document.

 

0 Likes
Message 6 of 7

Anonymous
Not applicable

I finally figured out how to even turn the sketches off in the view.  There is a tick mark that says includeIncludeScreenShot.png

Does anyone know how to use that in iLogic, or VB.NET?  I am currently looking...

If you uncheck the include mark, then the sketch is no longer visible.  That is what I need!  one step closer...

0 Likes
Message 7 of 7

Anonymous
Not applicable
Accepted solution

 

Well, I think I figured out how to make the sketches disappear the way I want them to.  It turns out the only way to hide sketches on a drawing is to create a rule in the drawing doc that hides the visibility of the sketch.  So thats what I have been trying to do today.  

 

The following code makes it happen.  There are a few tweeks to work out like how to always have the same drawing view number and a few other glitches.  However, now I am able to turn on and off sketches as I need to.

 

I Copied a blog by Xiaodong Liang  with how to do this.  However, I was not using an assembly only a part document.  

I also defined my part document with the actual file because that will not change.  However, the method follows so here is a link to that artilce for those that want it.

 

http://adndevblog.typepad.com/manufacturing/2016/03/inventor-api-hide-surface-bodies-of-drawing-view...

 

 

Sub Visibility()


Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oView As DrawingView
Set oView = oDoc.ActiveSheet.DrawingViews.Item(1)

Dim orefdoc As PartDocument
Set orefdoc = ThisApplication.Documents.Open("K:\Inventor\Coils\TableforEvapInfo.ipt", False)

Dim oevap1 As PlanarSketch
Dim oevap2 As PlanarSketch
Dim oevap3 As PlanarSketch
Set oevap1 = orefdoc.ComponentDefinition.Sketches.Item(2)
Set oevap2 = orefdoc.ComponentDefinition.Sketches.Item(3)
Set oevap3 = orefdoc.ComponentDefinition.Sketches.Item(4)

Call oView.SetVisibility(oevap1, True)
Call oView.SetVisibility(oevap2, False)
Call oView.SetVisibility(oevap3, False)

0 Likes