Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flat Pattern questions 2

Status
Not open for further replies.

dogarila

Mechanical
Oct 28, 2001
594
We are using mainly sheet metal parts to build our machines. Our laser machine program accepts only dxf drawings. I am looking at ways to speed up a little bit the generation of flat patterns for our models.

1. One problem I have right know is how to control which face SW will show when creating a flat pattern view. I need to have the flat shown with the paper side (finish side) up. There is no way to specify in the model which side is the finished one. How does SW select which face is up when generating a flat pattern?

2. I found this piece of code in SW Help to generate a flat pattern view in a new drawing. I changed the sheet size to A size and the template name with my A size template. The problem I have is that the flat pattern view is bigger than my template. I know how to change the sheet scale. My question is how do I change the sheet scale so the flat view will fit the sheet? Based on the size of the model my sheet scale could be 1:1, 1:2, 1:4, 1:8, 1:16 or 2:1, 4:1, etc.
Code:
Option Explicit

 


' Paper size in millimeters

'   A     216 x 279

'   B     279 x 432

'   C     432 x 559

'   D     559 x 864

'   E     864 x 1118

'

'   A0    841 x 1189

'   A1    594 x 841

'   A2    420 x 594

'   A3    297 x 420

'   A4    210 x 297

 

Const TemplateSize          As Long = 1

Const PaperSize             As Long = 1

Const PaperWidth            As Double = 0.216   ' Meters

Const PaperHeight           As Double = 0.279   ' Meters

 

Sub main()

 

    Dim swApp                   As SldWorks.SldWorks

    Dim swModel                 As SldWorks.ModelDoc2

    Dim swDraw                  As SldWorks.DrawingDoc

    Dim swView                  As SldWorks.View

    Dim bRet                    As Boolean

 

    Set swApp = CreateObject("SldWorks.Application")

    Set swModel = swApp.ActiveDoc

    Set swDraw = swApp.NewDrawing2(TemplateSize, "G:\Working\SolidWorks Data\Templates\Drawings\A_LaserX.DRWDOT", PaperSize, PaperWidth, PaperHeight)

    

     Set swView = swDraw.CreateFlatPatternViewFromModelView3(swModel.GetPathName, "", PaperWidth / 2, PaperHeight / 2, 0#, False, False)

     

     Debug.Print swView.GetName2

     Debug.Print swView.FlipView

                    

     swView.FlipView = False

 '   Debug.Print swView.FlipView

    

End Sub
 
Replies continue below

Recommended for you

If you RMB on the Flat-pattern1 feature and select Edit feature, a Fixed Face will be shown. SW uses that face as the upper side of the flat pattern. Selecting another fixed face will alter the flat pattern orientation.

[cheers]
 
Thank you CBL. I think that solves question 1.
 
At my last job, the flat pattern drawing was always 1:1, when they weren't, we would get scaled parts. Cute, but useless.

"Art without engineering is dreaming; Engineering without art is calculating."

Have you read faq731-376 to make the be
 
2) Go to Tools > Options > System Options > Drawings and select the Automatically scale new drawing views option.

[cheers]
 
It is already checked. It works when I insert the view manually. It doesn't with the macro.
 
dogarila,

Click on the background of your drawing, and select Properties. Set the sheet size and the scale.

Click on the view on the drawing, and look at all the stuff in your browser. There are several ways to select the view you want.

When I want a flat pattern on a drawing, I create a flat configuration of my part. All I have to do on the drawing is display that flat configuration.

JHG
 
drawoh,

I create a separate configuration for flat patterns also (or used to), but now I notice that when I bring in a sheet metal part onto a drawing SWX automatically creates a derived configuration "DefaultSM-FLAT-PATTERN" (if the base config is named "Default"). This adds a feature "Flat-Pattern1" to the FM.

I am now using this derived FP because it:
a) is automatically created
b) is derived so there isn't the problem of the FP having different dimension values or suppression states from the bent part (as has happened occassionally with the separate configs).

There are usually multiple ways to accomplish anything in SWX, sheet metal included. My own preference is to model the part as I want it and then turn it into sheet metal at the end. In doing this you must select a reference face - this is the face that defines the top of the part as it appears in the FP view and is the one refered to by CBL above. Using this method to create sheet metal you can still edit the S/M feature and pick a different reference face.

Also, in the drawing you can rotate and flip the FP view. So even if the top face isn't the one you want as top for generating the DXF you can flip it over to get what you want.

Our standard S/M drawings usually consist of two sheets. The first defines the finished part and the second is the FP with bend instructions. Our FP view also contains the standard note intended for the press brake operators: "BURR SIDE IS BOTTOM OF PART" because we have had some parts bent backwards. The BEND UP/DOWN notes are with respect to the FP and therefore as the operator would be looking at the top of the part as it comes off the punch (or laser in dogarila's case).

The automatic creation of the derived FP is new to me. It probably came in around 2000 and I never noticed because I didn't do any S/M then (and I rarely get very far through the "What's New" guides). This is a new feature I wish I'd known about sooner. Does anybody know when this came about?

- - -Updraft
 
Updraft,

I convert my parts to sheet metal as late as possible too. I am not always clear on how things are going to be fabricated as I work on the design.

I only do flat layouts when I want to show the fabricator how I want inside corners relieved. We subcontract everything. Our subcontractors usually ask for the SolidWorks model, so that they can do the flat layout. I assume that a big part of dogarila's problem is that he is supporting in-house manufacturing, and that the tools are somewhat limited.

I did not know about the automatic extra configuration. I will have to check. If I do not need it, I would rather not have it.

JHG
 
Coming from the manufacturing side I'm sorry to tell you that dimensioned flat patterns from a customer are largely useless because the bend deductions are not correct. Even if you use "industry standard" values many shops have their own and will change the bend deductions accordingly.

To get back to dogarila's question 2, if you are converting the flatpattern drawing in solidworks to a .dxf for the laser then you don't need it to fit the sheet. The conversion process will take the whole part not just what is inside the printable area and convert to .dxf. Also why would you want any scale other then 1:1 because even if you remember the dxf is another scale and adjust it in your nc software the next guy will have no idea and will waste alot of work. Hopefully the job wouldn't make it to the floor before someone catches the error.
 
Coming from the manufacturing side I'm sorry to tell you that dimensioned flat patterns from a customer are largely useless because the bend deductions are not correct. Even if you use "industry standard" values many shops have their own and will change the bend deductions accordingly.
I agree. Whenever we contract work outside we don't supply flat patterns. We offer solid models on request and they can do their own development based on their shop standard.
The flat patterns drawings I am trying to create are for our shop based on their bend deductions experience.
To get back to dogarila's question 2, if you are converting the flatpattern drawing in solidworks to a .dxf for the laser then you don't need it to fit the sheet. The conversion process will take the whole part not just what is inside the printable area and convert to .dxf. Also why would you want any scale other then 1:1 because even if you remember the dxf is another scale and adjust it in your nc software the next guy will have no idea and will waste alot of work. Hopefully the job wouldn't make it to the floor before someone catches the error.
We have a work instruction procedure which specifies that we have to create drawings of the flat patterns. This is left from the time the company was using only AutoCAD and devlopments were done manually. AutoCAD is used now only for old projects and all new ones are developed in SolidWorks. What I wanted to do was to have a macro where I select a folder with a bunch of sheet metal parts and for each part set up the properties, put the flat in the middle of a sheet and save the drawing, automatically. I don't mind changing the scale if it's the same with the sheet scale. When I export the file to dxf I have the 1:1 checked and I get it 1:1 in AutoCAD.
 
Ok, now we are on the same page. Unfortunatly I don't have an answer for you. We made a fully dimensioned flat pattern for inspection of every part that went through my shop and every one was sized manually.
 
If you'll put this code at the end of your macro it will change the sheet scale until the view fits on the sheet. Note that this will only work if the view starts out centered on the sheet. It works by seeing if any part of the view is off the sheet and scaling down by half if it is. However, if the center of the view is off the sheet then it will never scale down far enough. The macro jumps out after 1/64 scale in this case.

Code:
Dim ViewBox As Variant
Dim ShtProps As Variant
ViewBox = swView.GetOutline
While (ViewBox(0) < 0) Or (ViewBox(1) < 0) Or (ViewBox(2) > 0.216) Or (ViewBox(3) > 0.279)
    ShtProps = swView.Sheet.GetProperties
    ShtProps(3) = 2 * ShtProps(3)
    If ShtProps(3) > 64 Then
        MsgBox "View location error"
        Exit Sub
    End If
    swView.Sheet.SetProperties ShtProps(0), ShtProps(1), ShtProps(2), ShtProps(3), ShtProps(4), ShtProps(5), ShtProps(6)
    ViewBox = swView.GetOutline
Wend
swModel.EditRebuild3

-handleman, CSWP (The new, easy test)
 
handleman, I think that's a really smart little routine. I will test it and use it in my program as soon as I will have a little bit of time. I see no reason why it wouldn't work. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor