Friday, 21 July 2017

Precise Move Table

                Do you need to enforce Revision Table position? or any table for that matter?

                We talked about how to place and locate various tables on drawings so this is not new info but it is best if we make a post of its own so you can find it faster.

                This will help you enforce common standard and procedures when working with new recruits/students/temporary workforce.

                The code will move your revision table to lower left corner of your sheet but I did touch on how to find and use other points on drawing.

I did play with “TableDirection” “kBottomUpDirection” & “kTopDownDirection” thinking that the point coordinates will change depending on the drawing style of the table but Inventor outsmarted me (that’s not hard) and worked perfectly out of the box.

                It seems table coordinates will always start from top left corner no matter of your header position (top/bottom) or table direction (bottom up / top down), so we do need to calculate the height of the table.

On this principle, you can play with “Border.RangeBox.MinPoint”  ”Border.RangeBox.MaxPoint” or even specific x y values “Border.RangeBox.MinPoint.X” “Border.RangeBox.MinPoint.Y” to locate it in a different corner.

                This also applies to “TitleBlock.Position” or “TitleBlock.RangeBox” in case you need it next to, or on top of the titleblock.

                You can even search for table specific name if you have more than one tables on the sheet, that’s not possible with revision tables but it is with custom tables.  For example, this will search for Parts List with specific Title:

For i=1 To oPartsLists.Count
    If oPartsLists.Item(i).Title = "PARTS LIST" Then
        oPartsList = oPartsLists.Item(i)
        Exit For

                So here is the code to move Revision Table:

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet

'if you want different positions youcan get the MinPoint.X or MaxPoint or MaxPoint.Y
'along those lines
Dim oBorderPt As Point2d
oBorderPt = oSheet.Border.RangeBox.MinPoint

Dim oRevTable As RevisionTable
'I assume you only have 1 rev table on the drawing
oRevTable = oSheet.RevisionTables.Item(1)

Dim oRevPt As Point2d
oRevPt = ThisApplication.TransientGeometry.CreatePoint2d _
            (oBorderPt.X, oBorderPt.Y  + (oRevTable.RangeBox.MaxPoint.Y - oRevTable.RangeBox.MinPoint.Y))

oRevTable.Position = oRevPt



Tuesday, 18 July 2017

Add Legend to Parts List

Can we add a legend to our drawing PartsList?

You can add a Custom Part on your Parts List or you can add a Virtual Part in the assembly but those will obey the Parts List format and you can’t merge the cells into a single one. I don’t suggest you add Virtual Part to BOM anyway because it will show up higher up in assemblies and I doubt anyone would want that.

What other options we have?

Create a symbol which you call and place every time. If you set the leader visible “off” it will look like a bit of text floating around but the invisible leader will allow you to attach it to views, or other elements and it will move with those by magic.

Some prefer to hardcode it on the border or titleblock but that doesn’t allow for much customization except if you use a prompted entry type field.

I don’t expect anyone to follow this but you can also manage your entire Parts List in Excel and after adding the legend to the bottom, you can place the spreadsheet as custom table on the drawing.

All this being mentioned you can add your Legend to your Parts List Title which is a single cell but you need to format your code in word, or other text editing software or even better have an iLogic code to do that for you.

If you are not iLogic fan then you can type your text in word, copy it and paste it in the Title field in Parts List editor but the next code is very easy, just give it a try...

Here is the iLogic code to add a Legend to your ParsList. It has a preset list already but it accepts user prompted values as well.

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet

Dim oPartsLists As PartsLists

' Process the rule, wrapping it in a transaction so the 
' entire process can be undone with a single undo operation. 
Dim trans As Transaction 
trans = ThisApplication.TransactionManager.StartTransaction( _ 
        oDrawDoc, "Change Title of Parts List")
    'I assume you ony have one Parts List on the sheet
    'get current title
    oPartsLists = oSheet.PartsLists
    oTitle = oPartsLists.Item(1).Title
    'ask for Legend
    oLegend = InputBox("Enter Legend", "Legend", "Mach=Machined, Fab=Fabricated")

    'set title
    oNewTitle = oTitle + _
                vbLf + _
                vbLf + oLegend
    oPartsLists.Item(1).Title = oNewTitle
'finish the transaction


Friday, 14 July 2017

Align Drawing Views

So.. What’s happening? Not much! decided to give a hand on Inventor Forum so I was quite busy there but good things emerge like this post about how to align drawing views.

In this case, the user wanted to place multiple parts on the same drawing and align them left side for visual comparison.

                When is this useful? How about progressive die sheet metal parts?

                Of course, you can place them in a common assembly constrain them and then create a view of that but that’s not what the user wanted.

                The other common technique is to create each bend as a separate unfold/refold operation and convert the model to an iPart where you document each step of the process by suppressing fold/unfolds. You can then place multiple members on each drawing and the views will be aligned (should be because they share the same model..)

                The next code will get the X position of the first view and align the rest according to it. Views on drawing are positioned by Center so you need to get the Width of the view and divide it by 2 but it’s all in the code.

                You need to take care of the vertical Y position of the view and the code will align on X


Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

Dim oView As DrawingView

Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet

' Process the rule, wrapping it in a transaction so the 
' entire process can be undone with a single undo operation. 
Dim trans As Transaction 
trans = ThisApplication.TransactionManager.StartTransaction( _ 
        oDrawDoc, "Alig Views")
        oFirstView = oSheet.DrawingViews.Item(1)
        'views are processed by center so we need to get center X and substract half view
        Dim XPos As Double
        XPos = oFirstView.Position.X - (oFirstView.Width/2)
        Dim oPoint2D As Inventor.Point2D
        'view position is XPos + half of each view
        For Each oView In oSheet.DrawingViews
            oPoint2D = ThisApplication.TransientGeometry.CreatePoint2D(XPos + (oView.Width/2),oView.Position.Y)
            oView.Position = oPoint2D
'finish the transaction



photo credit: Simon & His Camera Reflected Wings On A Steel Butterfly - London City Office Life 2017 Version (license)

Thursday, 29 June 2017

Tube and Pipe Improvement List


Ideas for Inventor

I have finally managed to publish all Tube and Pipe posts on Inventor Idea Station. I’ve split the original idea and documented another 65 or so.

A couple of remarks:

Idea 21 is has been posted before as an Individual item and it can be found here:

Idea 30 is work in progress. I can't replicate it and that might mean it was a temporary glitch or localized issue. If it can't be replicated then there's nothing to fix. 

Idea 84 is work in progress as well. Just before hitting the post button, a possible solution came to mind on how this might work, and if there is a workaround then it might not be an issue to be reported after all.

You can easily find all the ideas by searching for author "salariua" by category "Tube&Pipe" or by tags "overhaul, pipe, routed, systems, tube". Unfortunatelly not all of them have tags because there is a limit of 100 tags per hour and I had to drop some to keep posting.

This list was long in planning, started 2 years ago, and while these have been documented for months I had force myself and make the effort of publishing them because Autodesk was catching up and a few of them have been implemented in recent versions based on the Original Idea.

I know allot of you will blindly vote for them because you trust me, you are familiar with my work, or simply because you feel TP needs a massive consolidated effort to bring it up to date and the more ideas the better. I urge you to vote for the ones you care about and to study them carefully. While some are specific to my workflow, others will no doubt help you as well but they will be implemented by ranking number of votes.

I have to thank DRoam on Inventor Forum for grabbing the links and making one big list with active links. Please report back if the links are not working.

All in one, this is it. Thank you for your help on making Inventor a better product. Go and vote for the ones you feel need implementing.

Original idea: Tube and Pipe Overhaul
Tube&Pipe 001: “Place fittings without needing to populate first”
Tube&Pipe 002: “Glyph size setting”
Tube&Pipe 003: “batch delete work features”
Tube&Pipe 004: “Nodes break routes”
Tube&Pipe 005: “Place fitting options”
Tube&Pipe 006: “Keyboard shortcuts”
Tube&Pipe 007: “Work features visibility auto-off”
Tube&Pipe 008: “Branches”
Tube&Pipe 009: “Constrain Runs/Routes”
Tube&Pipe 010: “Remember last used size”
Tube&Pipe 011: “Multiple T&P assemblies”
Tube&Pipe 012: “Allow “violation mode” editing
Tube&Pipe 013: “Dynamic change size”
Tube&Pipe 014: “Positive/negative dimensions”
Tube&Pipe 015: “Return to parent not working”
Tube&Pipe 016: “Multi-selection working commands”
Tube&Pipe 017: “CC pipes & section views”
Tube&Pipe 018: “iProperties for CC items”
Tube&Pipe 019: “Include route centerlines for visible only”
Tube&Pipe 020: “Maintain manually changed sizes”
Tube&Pipe 021: “Multiple selections change sizes”
Tube&Pipe 022: “Speed up place from CC process”
Tube&Pipe 023: “Dimension with parameters”
Tube&Pipe 024: “Constraints for nodes”
Tube&Pipe 025: “Orientation of drawing dimension”
Tube&Pipe 026: “Isometric chain dimensions”
Tube&Pipe 027: “Changing annotation plane not working”
Tube&Pipe 028: “Saved without asking”
Tube&Pipe 029: “Filepath length”
Tube&Pipe 030: N/A
Tube&Pipe 031: “3D Ortho tool for 3D sketches”
Tube&Pipe 032: “Change Fitting Diameter inactive”
Tube&Pipe 033: “Delete not working”
Tube&Pipe 034: “Repeat Last Command missing”
Tube&Pipe 035: “Prevent fittings from changing orientation”
Tube&Pipe 036: “Default focus for commands”
Tube&Pipe 037: “Populate self-intersecting routes”
Tube&Pipe 038: “Change Fitting Diameter restores default fitting”
Tube&Pipe 039: “Match Properties function”
Tube&Pipe 040: “Orientation changes without notice”
Tube&Pipe 041: “Jumping pointer”
Tube&Pipe 042: “Change size screen refresh”
Tube&Pipe 043: “Auto constraint/dimension”
Tube&Pipe 044: “Auto-dimension for angles”
Tube&Pipe 045: “Automatic perpendicular constraint”
Tube&Pipe 046: “Routing from 3D points”
Tube&Pipe 047: “Constrain to 3D points”
Tube&Pipe 048: “Equal constraint”
Tube&Pipe 049: “Authoring iLogic iParts iAssemblies”
Tube&Pipe 050: “Move fittings with equipment”
Tube&Pipe 051: “Fittings report wrong angle”
Tube&Pipe 052: “Route construction line visibility”
Tube&Pipe 053: “Route construction line drawing visibility”
Tube&Pipe 054: “Vault Check-Out ”
Tube&Pipe 055: “Author Assemblies as TP fittings”
Tube&Pipe 056: “TP dynamic Construction Lines”
Tube&Pipe 057: “TP Construction Lines anywhere”
Tube&Pipe 058: “TP iParts iAssemblies, Shrinkwraps”
Tube&Pipe 059: “Retrieve TP dimensions in drawings”
Tube&Pipe 060: “TP Tubing with Bends Missing Constraints”
Tube&Pipe 061: “TP CC Library Rebuild”
Tube&Pipe 062: “TP Reuse Fitting Sets”
Tube&Pipe 063: “TP Dimension Error”
Tube&Pipe 064: “TP Delete Coincident Constraint on Node”
Tube&Pipe 065: “TP Fittings Not Moving”
Tube&Pipe 066: “TP Allow Rotate For All”
Tube&Pipe 067: “TP Hose Template not Honored”
Tube&Pipe 068: “TP Hose Fully Constrained Sketches”
Tube&Pipe 069: “TP Allow Import of Styles with Errors”
Tube&Pipe 070: “TP Move/Restructure Browser Fittings”
Tube&Pipe 071: “TP Hose Route Off by Default”
Tube&Pipe 072: “TP Allow Insert Fittings for All”
Tube&Pipe 073: “TP Stop Checking Out Fitings”
Tube&Pipe 074: “TP Rotating Fittings”
Tube&Pipe 075: “TP Place All Fittings”
Tube&Pipe 076: “TP Mirror Runs”
Tube&Pipe 077: “TP Clone, Copy, Rename”
Tube&Pipe 078: “TP Minimum Pipe Segment Violation”
Tube&Pipe 079: “TP Remove Pipes from Recent Open Documents”
Tube&Pipe 080: “TP Express Mode”
Tube&Pipe 081: “TP Bends Have Static Values”
Tube&Pipe 082: “TP Dimension on Browser Planes”
Tube&Pipe 083: “TP Min/Max on Inserting Nodes”
Tube&Pipe 084: N/A
Tube&Pipe 085: “TP Route Constraints Productivity Improvement”
Tube&Pipe 086: “TP Split Command off Center ”
Tube&Pipe 087: “TP Save Dialog Pop-up”
Tube&Pipe 088: “TP Save Dialog Pop-up”
Tube&Pipe 089: “TP Paste in Browser”
Tube&Pipe 090: “TP Route – Allow Angle Dimensions”
Tube&Pipe 091: “TP Show Constraints”
Tube&Pipe 092: “TP Drawing Dimension Error Tubing with Bends”
Tube&Pipe 093: “TP LOD Replace Fitting Error”
Tube&Pipe 094: “TP Dimensions Fail to Compute”
Tube&Pipe 095: “Remove ISOGEN info”
Tube&Pipe 096: “Loosing Authoring Info”
Tube&Pipe 097: “Improve Favorites Menu”
Tube&Pipe 098: “Constrain Against Sketch Route”
Tube&Pipe 099: “Connect Fitting to have Edit Orientation dialog”
Tube&Pipe 100: “Favorites cancels to Content Center”
Tube&Pipe 101: “Style Editor, replace multiple styles”
Tube&Pipe 102: “Allow Self draining, Multiple Angles”
Tube&Pipe 103: “Make Adaptive in User Folder ”
Tube&Pipe 104: “Make Adaptive Multiple Runs/Routes”
Tube&Pipe 105: “Edit Connection needs an Apply Button”
Tube&Pipe 106: “Allow us to remove Route Ghost Features”
Tube&Pipe 107: “Spaghetti Loops when Connect Fitting”
Tube&Pipe 108: “Allow Hoses to Start Both Ends”
Tube&Pipe 109: “3D Move Rotate Distorts Route”
Tube&Pipe 110: “Make Adaptive Suppresses Constraints”
Tube&Pipe 111: “Allow Publish to All CC categories”
Tube&Pipe 112: “Hide References Missing Option”
Tube&Pipe 113: “Fix Icon for Hidden Fittings”
Tube&Pipe 114: “Allow Routes to Continue From Other Routes”
Tube&Pipe 115: “Allow Include Centerline for Multiple Routes/Runs”
Tube&Pipe 116: “Cannot Use Different Lightning Environment”
Tube&Pipe 117: “Remove Fittings From Nodes”
Tube&Pipe 118: “Bend Radius Missing Error”
Tube&Pipe 119: “Defer Update Not Working in TP”
Tube&Pipe 120: “Place Parts and Fittings in Last Save Design View  Rep”
Tube&Pipe 121: “Change Fitting Orientation Random Not Working”
Tube&Pipe 122: “Smart Coincident Constraint”
Tube&Pipe 123: “Lock Fitting Orientation”
Tube&Pipe 124: “Allow Any Angle Elbow Routes”
Tube&Pipe 125: “Fix: Replace Family Template in CC”


Friday, 16 June 2017

Turn Routes On/Off

                It has finally caught up with me and I had to stop and write a code to turn Routes On/Off.

                Nothing fancy here but I found myself doing this so many times on this last project that I decided to make an iLogic external rule for it.

                This is very simple; just a few lines to check if the occurrence name starts with "Route" then turn the part off.

Dim oAssyDoc As AssemblyDocument
oAssyDoc = ThisApplication.ActiveDocument

Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = oAssyDoc.ComponentDefinition

Dim oLeafOccs as ComponentOccurrencesEnumerator
oLeafOccs = oAsmCompDef.Occurrences.AllLeafOccurrences

Dim oOcc as ComponentOccurrence

'get user input as True or False
wfBoolean = InputRadioBox("Turn Routes On/Off", "On", "Off", False, "iLogic")

' Process the rule, wrapping it in a transaction so the
' entire process can be undone with a single undo operation.
Dim trans As Transaction
trans = ThisApplication.TransactionManager.StartTransaction( _
        oAssyDoc, "Routes On/Off")

    For Each oOcc In oLeafOccs
        If String.Compare(Left(oOcc.Name,5),"Route",False) = 0 Then
            oOcc.Visible = wfBoolean
        Else If String.Compare(Left(oOcc.Name,4),"Hose",False) = 0 Then
            oOcc.Visible = wfBoolean
        End If
'end transaction for single undo

'upate the files