Showing posts with label pattern. Show all posts
Showing posts with label pattern. Show all posts

Friday, 9 December 2016

Part Number on Flat Pattern

I’ve told you before I like helping out on Autodesk Answer Days and it’s good to keep an eye on that when it happens.




That’s when you get some of the best questions because a lot of people have done the research, know there is no solution available unless an Autodesk employee looks at the code and provide the insight or blends a quick bit of code for your problem.

As I am aware not all of you have the time for it I try and share the best, rare, exceptional that catches my attention

                Exactly this case for the question “How to get Part Number on Flat Pattern”.

                Seems we have covered this before and you are correct to think this but it was a bit different for we have showed how to do that from the drawing using a symbol note before the export; you can read it all again here.

                But this is different for what he wants is to have the part number on the flat pattern in the model and I am guessing that is because he wants to do emboss it, cut it out or just have it as a text on his flat pattern exports.

                You know you can export the flat pattern or just a face, right?

                Right click on Flat Pattern and choose Save Copy As with sat, dxf, dwg as output or right click on a face and choose Export Face As with dxf, dwg as output.

               
Flat Pattern Save Copy As..



Export Face As

                The solution is simple brilliant and Cai from Autodesk has provided the answer.  Create a sketch on flat pattern face with a text in it and the code bellow will change that text to Part Number. All you need to do is run the iLogic code and watch the magic taking place.
               
Dim oDoc As PartDocument
 oDoc = ThisApplication.ActiveDocument
 
Dim oDef As SheetMetalComponentDefinition
oDef = oDoc.ComponentDefinition
 
Dim oSK As Sketch
oSK = oDef.FlatPattern.Sketches(1)
 
osk.TextBoxes(1).Text=iProperties.Value("Project", "Part Number")

How good is that? Because I find it brilliant.        

         Of course the user needed some more; as it happens with this things and we jumped right back to help him out.

         What if there is no sketch on flat pattern? Can I prompt the user to create it?

         Cai replied:

If oDef.FlatPattern.Sketches.Count >0 Then
 oSK = oDef.FlatPattern.Sketches(1)
Else
 ' There is no sketch
End If


And I (late as usual) told him to use a try/catch; here is the complete code:


Dim oDoc As PartDocument
 oDoc = ThisApplication.ActiveDocument
 
Dim oDef As SheetMetalComponentDefinition
oDef = oDoc.ComponentDefinition
 
Dim oSK As Sketch
Try
    oSK = oDef.FlatPattern.Sketches(1)
    osk.TextBoxes(1).Text=iProperties.Value("Project", "Part Number")
Catch
    MessageBox.Show("Sketch not found" _
                    & vbLf & "Please crete a sketch first", "No sketch")
    
End Try


Later,
ADS photo credit: Panoramas Washington - National Gallery of Art - Calder - 8-11-2014 - 17h18 (license)

Friday, 2 October 2015

Delete Pattern keep Components

I have been absolutely swamped with work and problems but I am slowly getting back to speed.

Really short one today as it's more to push things going but hopefully there's good info you can pick up.

If your design changes and where originally you had pattern of components you now need regular placed components to be manipulated and moved around then here’s a little trick.

                Usually when you delete a pattern all occurrences in that pattern will get deleted and only the first instance of the components will be preserved. The trick is to create the occurrences independent first and then you can delete the pattern which in fact will preserve any components and the position they had even if they were manually moved.

                 For a plant layout I did the other day I was told that the allocated space has shrink and we are now required to fit the units as best we can changing a nice pattern into whatever works. The units to change are quite big and for that matter I had to simplify/derive them to conserve memory and improve performance.

                Along with the sales engineer we took a quick look and moved the components around by the old pick and move routine. When we were pleased with the results I have created each component independent and then I have deleted the pattern. Each component has kept its move location  except for the first item in the pattern that Inventor has dragged back to the original constrained position.

                So you can first suppress the constraints of the main component (or activate defer update) then make each component independent and only then you should delete the pattern.




Later,
ADS

Wednesday, 15 October 2014

Sheet metal imports

Let me drop a couple of words on getting flat patters from imported components. I've seen a lot of imported parts lately created in other cad packages (Catia in this case) with punches that Inventor has problem creating flat pattern for.

The secret here is to use delete face with heal on and delete the inside of the punch first and only afterwards the outside faces of the punch in a separate delete operation. You can select inside faces of all punches for your first delete face operation.






If your vendor exported an assembly with one part, Inventor will imported it as multi-body part with one body and it will complain that it can't be converted to sheet metal.

In this case you can export it again to a neutral file format and import that back or you can use derive to get it all as one body.

I have a test model for you made with Inventor 2014 where you can try these out.

When you try and convert to sheet metal you will see that inventor complains about having multiple bodies so we need to derive it into a single body.

1. Open a new part.

2. Go to 3d model / create/ derive and browse to our file : 141017 Sheet metal imports.ipt

3. In the derived part dialog, expand solid bodies, and unmark Body.1 (you only need to have Body.13)

4. On the derived style select single solid body and click ok.





Even though we have only one body it seems that the round inserts at the end of the arms are modeled in so we need to remove them to a constant thickness part.

5. Extrude-cut the sheet metal nuts (round inserts)


6. Select the inside faces of the punches, one at a time or all at once. Start the delete face operation and after marking heal option click ok. You should have something as in the images bellow.





 7. Repeat the operation again for the outside faces of the punches. The end result should be like this:





 8. Verify the thickness and change it accordingly in the sheet metal options.

9. Use flat pattern. You might need to select one face (inside face) before flat patterning if it doesn't unfold. You might also need to delete the existing flat pattern if any to get it to compute.



And of course a video.



ADS

Wednesday, 8 October 2014

Part info on dxf exports

Today I'll show you my way of showing part info on dxf exported drawings. Every once in a while we do dxf profiles of flat pattern sheet metal parts and we need to add more info to each export. We don't always have time to do a drawing for each part but we add views of flat pattern parts on the main assembly layout (or in separate sheets) so we need the extra info on the views for the manufacturer.
We normally have: Part number, Material, Quantity, and Thickness as a note linked to each flat pattern view.

Here's how we do it:
1. First you need to expose the Thickness parameter of the model so go in functions (part environment) and mark "Export" box on Thickness. I would suggest you do this on the sheet metal template and maybe part template as well (in case you use the convert to sheet metal option).

This will add the thickness in custom iproperties of the part.
2. Create a drawing and add a view of a sheet metal part.
3. Add a custom symbol and in the sketch start a text with the following values:
Part Number: <PART NUMBER> link this to the model properties.
Material: <MATERIAL> link this to the model properties.
Finish the symbol creation for now.

4. Add custom part iproperties PJ_QTY :
4.(a)  manually in the part properties
4.(b) In the BOM of the assembly. Open the BOM inside the main assembly (main project assembly) and go to parts only (you might need to enable it first). Click on add custom iproperties, type Thickness and type PJ_QTY (or whatever your want to call the part quantity). Add "Item Quantity" and have it next to PJ_QTY. Select the values on the Item Quantity and drag the lower corner of the last cell towards the PJ_QTY row just like in Excel. The PJ_QTY  part properties gets created on all parts with the value from Item Quantity on it.







5. Go back to the drawing and place your symbol on an edge of your sheet metal part just like you would do with a balloon.

6. Edit the symbol, and the text in it. Because we linked it to a part with custom iproperties they are available to be referenced. Let's add the following text:
Quantity: <PJ_QTY> link this to the custom properties of the model.
Thickness: <THICKNESS> link it to the custom properties of the model as well.

7. Finish the symbol editing.
Now you can copy/insert it on any view, on any drawing before dxf export.
I would suggest that you copy it to the drawing template ready to drop in when needed.




Notes:
If you want to add Thickness to standard.ipt template you would be better to open it, convert it to sheet metal and back to normal. The parameters are part of it now and you can mark export on Thickness.
And the video:



ADS.

--------------------------------------------------------------------------------------------------------------------------
EDIT: 14 - 08 - 2015

In AIP 2015 that I am using now it exports fine but if the dxf export shows up <PART NUMBER> instead of the actual value you need to tweak your export options to convert Drawing Symbols to Blocks.

In the Save As dialog click Options, then click Next in the DXF Export Options and in the Export Destination window click on Mapping Options. In the General tab click Convert Drawing Symbols to Blocks. You can save the configuration for later reuse if you want.

If you need to explode the block in Autocad head over to Express Tools (this needs to be marked at installation it doesn't' come by default) and then use Explode Attributes rather than using the explode command.

In 2015 no matter of the settings in the save as options or the explode method it's working but in older versions I remember needing to take this steps.



Let me know how that goes,
ADS.