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 I EDIT THE DYNAMIC PARTS LIST GRID??

1 REPLY 1
Reply
Message 1 of 2
LOONYLEN
569 Views, 1 Reply

CAN I EDIT THE DYNAMIC PARTS LIST GRID??

My company structures a parts list on detail drawings a certain way.

I need to edit the parts list actual table grid layout.

Please see attached.

 

Is this something that can be accomplished?

Senior Designer/Cad Administrator
Inventor 2012, w/SP2
Vault Collaboration 2012
Dell Precision T3500, Intel Xeon CPU
W3680 @3.33GHz, 16.0 GB of RAM
Microsoft Windows 7 Pro, 64 Bit Edition
Version 2009, w/SP1
1 REPLY 1
Message 2 of 2
adam.nagy
in reply to: LOONYLEN

Hi,

 

I don't see an easy way of doing it.

If you want to blank out some of the table lines from printing then that should be possible by drawing a white sketch line in front of it. This code blanks out the top line of the cell in the 2nd row and 3rd column:

Public Sub GetCellTopLinePoints(pl As PartsList, row As Integer, col As Integer, ByRef sp As Point2d, ByRef ep As Point2d)
    Set sp = pl.Position.Copy()
    Set ep = pl.Position.Copy()
    
    Dim i As Integer
    
    For i = col To pl.PartsListColumns.Count
        ep.x = ep.x - pl.PartsListColumns(i).Width
    Next
    sp.x = ep.x + pl.PartsListColumns(col).Width
    
    For i = 1 To row - 1
        ep.Y = ep.Y - pl.PartsListRows(i).Height
    Next
    sp.Y = ep.Y
End Sub
 
Public Sub PartsListTest()
    Dim dwg As DrawingDocument
    Set dwg = ThisApplication.ActiveDocument

    ' Select the parts list first
    Dim pl As PartsList
    Set pl = dwg.SelectSet(1)
    
    Dim sp As Point2d
    Dim ep As Point2d
    Call GetCellTopLinePoints(pl, 2, 3, sp, ep)
    
    On Error Resume Next
    ' Let's keep refreshing the same sketch
    Dim ds As DrawingSketch
    Set ds = dwg.ActiveSheet.Sketches("PartsList")
    If Not ds Is Nothing Then
        ds.Delete
    End If
    On Error GoTo 0
    
    Set ds = dwg.ActiveSheet.Sketches.Add()
    ds.Name = "PartsList"
    
    Set sp = ds.SheetToSketchSpace(sp)
    Set ep = ds.SheetToSketchSpace(ep)
    
    ds.Edit
    
    Dim sl As SketchLine
    Set sl = ds.SketchLines.AddByTwoPoints(sp, ep)
    
    Dim tr As TransientObjects
    Set tr = ThisApplication.TransientObjects
    
    sl.OverrideColor = tr.CreateColor(255, 255, 255)
    
    ds.ExitEdit
End Sub

I hope this helps.

 

Cheers,



Adam Nagy
Autodesk Platform Services

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

Post to forums  

Autodesk Design & Make Report