Showing posts with label Autodesk. Show all posts
Showing posts with label Autodesk. Show all posts

Friday, 23 December 2016

Fitting Alignment Issue

What’s wrong with these fittings?
 
Weird alignment

weird again.


My fitting orientation is all wrong.  You will get this especially on zero dead leg valves for pharmaceutical products but I’ve seen this on other products.

If you create a plane between the 3 connection points of the valve you will see that it’s not parallel with the rest of the geometry, valve body in my case.

default orientation

The direction is given by the 3’rd connection perpendicular to the line between the first and second. I think this is to help out with inexperienced users, idiot proof really, helping out if you didn’t align your connections to the model but that's just for straight fittings like tees.

Now what? Am I supposed to measure the angle every time and change fitting orientation on a continuous loop? (rolling eyes).

In order to fix this you need to add another authoring point and make it a 4 point connection.

4 Connections on a 3 point fitting? Are you mad?

I thought we already established that and we’re here to have some fun and solve some problems.

 We will be creating the 3rd connection inline (same plane) and parallel with the fitting as spare, never to be used and instead the 4th connection is to be used.

It might help to make the 3rd on a different plane away from 4th like right on the origin line just so it’s out of the way when placing or connecting fittings to it. We want to make it very obvious from the snap preview that it’s not the one to be used.

authoring dialog window

I have also gave it a really small connection size; a size we would never use like 1/8” to differentiate it even more and keep people from connecting to it.

And this is what the difference between placing a 3 or 4 connection fitting looks like
 
compare the results.
I’ve given this example before on autodesk forum on a similar issue.

You can keep just 3 connections if you align the third but we can do better.

3 would do but 4 is better


I feel it’s best to have a 4’th connection but be careful on placing fittings.

Watch out for ghost connection when placing this fitting. 

Later,
ADS
               

                

Wednesday, 21 December 2016

Punch iFeatures

You have no excuse!


iLondon
I will explain this one again and you will no longer have an excuse.

 You will have to force yourself and use it but trust me it will save a lot of time and increase your productivity.

I’ve seen this one too many and it’s killing your productivity and possibly your enthusiasm on using features, especially punch features.

First of all what are iFeatures?

Autodesk dictionary helps us out:
“Converts a single feature or a collection of features into a feature you can reuse in other part files.”

The definition is a bit circular, I agree. What that means is that if you model the same things everyday (keyways, for example) then you better make those an iFeature and reuse them.

Furthermore the iFeatures can have a table and you can generate custom sizes from easy to use forms with drop down menus and you can even have custom prompted values, with range and increment.

You will get a new file type "ide" but you can even drag-drop it from windows explorer.

I use them all the time and I have all sorts of ifeatures like flanges, ferrules, pipes, but especially features for my tanks and vessels, like manholes-manways, spray balls, feet, ladder attachments, lifting trunions, on and on...

One essential rule is to have the feature self-contained and do not reference any other geometry. If you do need to make it depended then only reference features to be included in the ifeature element.

 A special case are the Punch iFeatures for which the first element needs to be a sketch with a work point; this will be used as the insertion point and is especially helpful with recurring patterns.

We are here because you spent a lot of hours planning ahead, tested your ifeatures and perfecting the technique of making them independent and yet they fail to work. The work feature is not normal to the face and you have punches that are not protruding the sheet metal part.

And that is because your work is too perfect! That’s right, you need to take a step back, don’t make it quite that independent and reference the sheet face.

Typical procedure is to create a sketch and place a work point on it. Then create a construction line trough the point and finish the sketch.

Now you have the insertion point for your punch ifeature. You then create a work plane where you model the sketch of the punch.

The wrong way to do it is to create the workplane from the sketch workpoint and the sketch construction axis. At this point the ifeature will have no reference to the sheet face and it will spin in space as it sees fit.

Wrong way of doing it:


Wrong way of doing it

Correct way of doing it by referencing the construction line and the face where the sketch is defined.

Correct way of doing it

Don’t worry the face has been referenced before when you created the insertion point so you'll still have only one reference to pick when placing this.

Wrong way of doing it, end result:

Wrong way - wrong results

Correct way of doing it, end result:


Correct way - correct results

Repeat after me:
“I will use ifeatures from now on, save time and increase productivity”

 Later,
ADS


photo credit: @Doug88888 London - Light painting London (license)

Component Sketches Off


I hate when people don’t clean up their models. Although not right my mind associates this to a messy person with unclean desk, car, and garage, buried in piles of unneeded stuff.



                OCD is my middle name and while I hate this side of you, I love you as well and I think maybe you weren’t taught how to do it properly.

                I suggest you never use the “Object Visibility” drop down on the View tab.

I NEVER USE IT; except to see if you’ve been cheeky and got this quick fix like a drug addict.

It’s a crapshoot and it will bite you faster than you think. Have you considered the time, effort and stress you are going to experience when using this in large assemblies.

That’s all I am going to say and I will share  a bit of iLogic code I use to clean up this mess I see regularly with sketches not being turned off.

I have another one where I turn off the visibility of workfeatures, WorkPoints, WorkAxis, WorkPlanes and I like to keep it separate from the sketch visibility because when using it with tube and pipe it will turn the routes off and I don’t want that.

Component Sketches Off

I have also wrapped the whole process as a single transaction because if I need to undo the operation I only need to do a single undo not clicking back for each sketch that is off.


Code below and in this download link

-------------------------------------------
'catch and skip errors
On Error Resume Next
'define the active assembly
Dim oAssyDoc As AssemblyDocument
oAssyDoc = ThisApplication.ActiveDocument 

'get user input as True or False
wfBoolean = InputRadioBox("Turn all Sketches 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, "Sketches Off")

'Check all referenced docs
Dim oDoc As Inventor.Document
For Each oDoc In oAssyDoc.AllReferencedDocuments
    'set Sketch visibility
    For Each oSketch In oDoc.ComponentDefinition.Sketches
    oSketch.Visible = wfBoolean
    Next    
    
Next

'end transaction for single undo
trans.End 

'upate the files
InventorVb.DocumentUpdate()
-------------------------------------------


Later,
ADS
photo credit: Rubina V. Jahrmarkt (license)

Friday, 21 October 2016

Drawing layers

                Do you use layers in Inventor drawings? Or do you consider them legacy, obsolete, pre cretaceous kind of animal?

Add caption

Last week we looked at showing hidden lines for buried components and now we look at a different method for doing that but with the additional benefits.

                When detailing pipe routes you can use the “Include Route Centerlines” command but if that view is a detail, section, cropped view you end up with a lot of extra lines. You can use this method to clean them up as well.
Include Route Centerlines, adds more than visible.
               

                Another good example is the worm gear bellow. I have an M10 hole on center and I can’t really show it properly. Top left to bottom right I have hidden lines view, normal view, hidden break out view, normal breakout view and yet not of them looks good enough.

Top left - Hidden Lines, Top Right - Normal,
Bottom Left - Hidden Break Out, Bottom Right - Normal Break Out

                What I tend to do is turn the hidden lines on for that view then edit the layers, where I turn off every one of them except Hidden and Hidden Narrow and save the style. Now I only have left the hidden lines which makes it so much easier to delete the extra stuff.
               
Turn layers off to help your selection.

                TIP: On the edit layers dialog window you can SHIFT select them all and when you click the light bulb the visibility changes to all at once.

                TIP: It’s much easier to do a window selection and select all and then hold down CTRL and deselect the view, and other curves that you need keeping. You can then use the Visibility on the right click menu to turn them off at once.

                And there you have it. Hope you’ll put this to good use and give layers a chance ; they are not used just for AutoCAD exports only.

Later
ADS


                
photo credit: Eugen Naiman layers (license)

Thursday, 13 October 2016

Drawing Hidden Lines

In the drawing have you ever needed to show components buried down below?



I didn’t have a lot of time this week for blogging but I forced myself to wake up early today and write a couple of words on this trick I use quite a lot. Will try and keep it simple for now and will do a follow-up next week on layers and how to leverage them to your advantage.

                A lot of the times I find myself in need to indicate components that are not visible unless you change the view to hidden lines. That can be daunting for untrained eye to look at and it will clutter the drawing so I tend to avoid it if I can.
               
For example take a look at the vessel in the image bellow. Turning the view to hidden lines would have made a mess out of it with no way to identify what’s what. Showing just the legs in hidden lines makes a huge difference.

Hidden lines accentuate design.
To show a component you need to find it in the browser, right click, and choose "Hidden Lines".

Enabling hidden lines

As soon as you set hidden lines on you get a message saying "Dependent vies styles will become independent”.

Changing the view message

Sometimes the “Hidden Lines” menu will be grayed out and that is because your view has linked design view representation. For that you need to edit your view and tick the “Associative” box off as bellow.

Associative off on view properties

A new option is needed here besides “show hidden lines” and that should be simply “show” which will turn the model visible (in dotted lines because it is underneath in the background) without its internal geometry. I need to indicate the component in outline, not the whole geometry but that’s for a latter post.

Next new feature?
   
Take a look at the drawing below. The drain header is visible and I only need the outline body; normally we show all runs in hidden lines but this is just a sales proposal and I couldn't be bothered. This shows just enough info, eliminating clutter and accentuating design.

Way better, isn't it?

Later,
ADS


photo credit: Max Garçia Metallica (license)

Friday, 7 October 2016

T&P Hoses P2 - Documenting Hose Lengths

How do I show hose lengths? How to document hoses? I need to document cut lengths, swage distance as well as overall lengths, so how to do that?

               

                Last week we covered BOM structure for hoses and I’ve showed you how to mark them as single items in BOM / Parts List. This is useful if you don’t’ manufacture the hose and you don’t need to show all the sub-parts individually.

                But what if you need to show those dimensions and send the drawing over to whoever is going to manufacture it; assuming it’s not a standard stock item.

                Hoses are created as a subassembly in tube and pipe and you get the route, the sweep part and the connectors (depending on style settings) in one single assembly.

Hoses are created as assemblies

                Unfortunately the info is not at the assembly level and it can’t be exposed when changing BOM structure to “Purchased” or “Inseparable” (check my previous post here). All the info is created in the hose part (the one containing the sweep).

                If you open the hose and check the parameters window you can find a couple of parameters defining the various lengths for the hose (they are exposed as custom iproperties as well.)

                If you open the parameters window here’s what you will find:
PL - Pipe Length (hose in this case)
RPL - I believe this is "Rounded Pipe Length" (hose in this case)
OPL - I believe this is "Overall Pipe Length" (hose in this case)
ROPL - I believe this is "Rounded Overall Pipe Length" (hose in this case)

Parameters exposed to iProperties.

If you have connectors each end (like I do) you will notice that the sweep sketch is made from a spline and 2 straight lines (swage distance). Measuring the spline and the individual lengths you will get PL(hose length) which is then rounded to the nearest increment (changeable from the T&P route style) and you then get RPL (rounded hose length).

Rounded increment is declared in the Route Style

OPL (overall hose length) you get by adding the connector lengths to the PL (hose length) and just like above when you round this to the nearest increment you get ROPL (rounded overall hose length).

                If you need this info in the Parts List you need to add these custom iproperties manually by editing the drawing table. However if you marked the hose as “Inseparable” or “Purchased” the info will not show up.

                In both cases you can add a Leader Line and use the “Custom Properties – Model” to show these on the drawing.
Use Leader Lines to document the various lengths
                Here's a short animation of the process.




Later,
ADS photo credit: Garden hose (license)

Monday, 3 October 2016

T&P Hoses P1 - BOM Structure


Do you include hoses and flexible tubing to your design? Are you thinking into taking your products to next level by adding this info to your design?




While we use them in our plant layouts we don’t really document them on the drawing but nonetheless there are some good practices as well as tips and tricks.

Will keep this simple and split it into separate blogs and for now the question is:

How can I show a hose assembly as single part?

We are not hose manufacturers so it would help to see the assembly in the Parts Only section of the BOM along with all the fittings, valves, conduits, all parts really to be purchased.

This needs editing the BOM and changing the “BOM Structure” field to one of these 2 options:

- Mark it as “Purchased”

-Mark it as “Inseparable”

For all my life I have been thinking about “Inseparable” items as welded, casted, glued, press fitted, riveted kind of items but it’s really just a way of grouping several parts in BOM.

“Purchased” it’s what I’ve been using and it’s a nice way of merging multiple parts as a single item. Think of skids, tanks, etc. or any assembly which you vendor has sent over and you consider that a single purchase / single item.

The advantages of keeping it or importing it as assembly rather than single part is you can play with Level Of Detail (LOD), Design View Representations or show different positional representations.

 In the Structured tab you can still expand and collapse it (if show all levels is active), edit the iproperties but now it shows up in the Parts Only section of the B.O.M.

At this point should mention that if you want to show the child components of the hose assembly you will change the BOM Structure to “Phantom”. This will promote the children and hide the subassembly; I use this all the time to group things together for less constraints, improved pattern, etc.


Changing Bom Structure type.
Later,
ADS


photo credit: Steel-braided hose (license)

Thursday, 22 September 2016

Tag Top Level Components

And yet again the question of “how to indentify same parts with different labels-marks-balloons” has passed my way. This time it’s a variation of the previous but the answer stays the same and as far as Inventor is concerned, at the moment there is only one solution.

Are you looking for balloons?

As most stuff on this blog it’s not documented and only came to me after long years of testing the software but I have been using it successfully ever since.

While you can add notes, balloons or leader texts to your drawing, they will not update and you need to manually adjust these every time. Don't get me wrong, the values will not update automatically with this method either but we will use ilogic code to force update them all..

The only way to tag equipment is to use assembly browser name. That stays unique to each occurrence (component) and while a valve can be used 100 times in the assembly and reside in library (read only folder) you can change the browser name in the assembly and give it an unique ID.

If you don’t know what I am taking about or you need a refresh, start with this post where I am explaining this concept and the setup of custom balloons in the drawing.

Then read the update on tagging from the assembly, which might be faster/preferred by some people.

Then there’s the final code to use in the drawing which merges both codes and creates the balloon on the drawing and renames the assembly browser node. If that component (eg. Valve) has a tag already then it prompts the user to change the value.

I should mention that it is possible to create a custom table to extract tagged equipment with any iproperties you wish along (eg. PN, Description, Stock Number, etc.).

here's how to create custom table:

and here's how to edit a Parts List table:

Now that we’ve cleared that out, how would I tag top level components like documenting nozzle on a tank assembly?
                While I am used to label end components this time we need to label top level subassemblies.
                Start by creating a custom balloon style, so that the code will only change those and ignore any standard balloons like Item Number and Quantity.
                Then we have several options:
1.       Balloon the items (make sure you select correct style).
a.       Use ilogic to update the value of balloons you select on screen.
b.      Use ilogic change the values of all balloons of that style current sheet / all sheets (complete drawing).
2.       Use ilogic to create balloons on the fly, prompt the user for tag value, and override the value on the assembly browser node and on the balloon.

For simiplicity I have created the second option where the balloons are created for you. Try this out and let me know how that goes.

--------------------------------------------------------------------------------------------------

'this sets a tag to each selected component and creates
'a balloon for it, asks for update of existing balloons

' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

' Set a reference to the active sheet.
Dim oActiveSheet As Sheet
oActiveSheet = oDrawDoc.ActiveSheet


Dim oStyles As DrawingStylesManager
oStyles = oDrawDoc.StylesManager

Dim oCurve As DrawingCurve
Dim oEdge As EdgeProxy
Dim occurrence As ComponentOccurrence 
Dim oGeometryIntent As GeometryIntent


While True
    Try
        ' Get a drawing curve segment selection from the user
        Dim oCS As DrawingCurveSegment
        oCS = ThisApplication.CommandManager.Pick( _
                SelectionFilterEnum.kDrawingCurveSegmentFilter, "Pick a drawing curve segment")
                                            
        If oCS Is Nothing Then
            'MessageBox.Show ("Selection was cancelled","ilogic")
            Beep
            Exit While
        End If
                
        oCurve = oCS.Parent
        oEdge = oCurve.ModelGeometry
        occurrence = oEdge.ContainingOccurrence
        While Not occurrence.ParentOccurrence Is Nothing
            'MessageBox.Show("Parent Occ name: " & occurrence.ParentOccurrence.Name,"ilogic")
            occurrence = occurrence.ParentOccurrence
            'MessageBox.Show("cur Occ name: " & occurrence.Name,"ilogic")
        End While 'end test for parent
        'MessageBox.Show("Old Occ name: " & occurrence.Name,"ilogic")
        
        Retry = True
        
        'as long as retry is selected by user
        While Retry
            'get tag from user
            oTagOcc = InputBox("Enter Tag No: ", "Tag Prompt", occurrence.Name)

            Try
                ' try and set that value
                occurrence.Name = oTagOcc
                'if success exit the retrying loop
                Exit While
            'if tag allready exists
            Catch
                'prompt if user wants to try again
                Retry = InputRadioBox("Allready used, try again", "Yes", "No", Retry, Title := "Retry")
            End Try
        End While
        
        'if user canceled the retry skip the rest of the code and
        'prompt to select parts again
        If Retry = False Then
            Continue While
        End If

        'Get the mid point of the selected curve
        ' assuming that the selection curve is linear
        Dim oMidPoint As Point2d
        oMidPoint = oCurve.MidPoint
        
        ' Set a reference to the TransientGeometry object.
        Dim oTG As TransientGeometry
        oTG = ThisApplication.TransientGeometry
        
        Dim oLeaderPoints As ObjectCollection
        oLeaderPoints = ThisApplication.TransientObjects.CreateObjectCollection
        
        Try
            ' Create a couple of leader points.
            Call oLeaderPoints.Add(oTG.CreatePoint2d(oMidPoint.X + 0.5, oMidPoint.Y + 1))
            'Call oLeaderPoints.Add(oTG.CreatePoint2d(oMidPoint.X + 1, oMidPoint.Y + 0.5))
        Catch
            MessageBox.Show("Circular segment found," & _
            vbLf & "Can't get sement center," & _
            vbLf & "Manually move balloon please", _
            "Position error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
        
        ' Add the GeometryIntent to the leader points collection.
        ' This is the geometry that the balloon will attach to.
        oGeometryIntent = oActiveSheet.CreateGeometryIntent(oCurve)
        
        Call oLeaderPoints.Add(oGeometryIntent)
        
        Dim oBalloon As Balloon
        Try
            oBalloon = oDrawDoc.ActiveSheet.Balloons.Add(oLeaderPoints)
        Catch 
            MessageBox.Show("Can'te activate BOM." & _
            vbLf & "Temporary add a Parts List on the sheet" & _
            vbLf & "You can remove it later", "ilogic")
        End Try
        
        'set the style of the balloon to "Tags"; if you don't have a style called tags
        'you can remove this to keep it as default or use some of these settings:
        'oBalloon.SetBalloonType (kHexagonBalloonType)
        '---------
        'other options here are kCircularWithOneEntryBalloonType, 
        'kCircularWithTwoEntriesBalloonType, kHexagonBalloonType, 
        'kLinearBalloonType, kNoneBalloonType And kSketchedSymbolBalloonType
        '---------
        oBalloon.Style = oStyles.BalloonStyles.item("Tags")
        
        Dim oBalloonValueSet As BalloonValueSet
            
        ' Iterate over each value set (attached balloons) in a balloon.
        For Each oBalloonValueSet In oBalloon.BalloonValueSets
            ' Set balloon value from browser.
            oBalloonValueSet.OverrideValue = occurrence.Name
        Next

    Catch
    'end try
    End Try
End While

'----------Update existing balloons on all sheets

'Ask the user if he wants to update values of all balloons (if edited some)
booleanParam = InputRadioBox("Update existing balloons?: ", "Yes", "No", True, Title :="Update Existing?")

If booleanParam = False Then
    Exit Sub
ElseIf booleanParam = True
    
'process all sheets
For Each oSheets In oDrawDoc.Sheets 
        ' Iterate over each balloon on the sheet.
        For Each oBalloon In oActiveSheet.Balloons
            If oBalloon.Style.Name = "Tags" Then
                Try
                    Dim leader As Leader
                    Leader = oBalloon.Leader
                    'assuming the leader is a single line segment
                    Dim leaderNode As LeaderNode 
                    leaderNode = leader.AllNodes(2)
                    
                    oGeometryIntent = leaderNode.AttachedEntity
                
                    curve = oGeometryIntent.Geometry
                
                    oEdge = curve.ModelGeometry
        
                    'occurrence = oEdge.ContainingOccurrence
                    While Not occurrence.ParentOccurrence Is Nothing
                        'MessageBox.Show("Parent Occ name: " & occurrence.ParentOccurrence.Name,"ilogic")
                        occurrence = occurrence.ParentOccurrence
                        'MessageBox.Show("cur Occ name: " & occurrence.Name,"ilogic")
                    End While 'end test for parent
                    
                    ' Iterate over each value set (attached balloons) in a balloon.
                    For Each oBalloonValueSet In oBalloon.BalloonValueSets
                        ' Set balloon value from browser.
                        oBalloonValueSet.OverrideValue = occurrence.Name
                    Next 'go to next balloon
                Catch'do nothing if error
                End Try
            End If 'end of search for Tags balloons
        Next
    Next
End If

'----------End Update existing balloons on all sheets


---------------------------------------------------------------------------------------------------
Later,
ADS.
                                                                                                                                                                  
photo credit: Mass Ascension (license)