Im trying to get an idea of what the majority of people in the
manufacturing industry that uses SolidWorks for sheetmetal does.
My company currently exports the flatpattern in a drawing as a dxf.
Then the dxf is converted to a GEO file by manufacturing. They then
use the GEO file to make a nest for the laser.
We have a hell of a time converting drawings to dxf, since the process
is somewhat somewhat long.
First we have to delete the sheet format, which has title block and
notes on it. Next we have to manually hide the bend lines. Clicking
"Hide All Types" doesnt hide these, although it looks like it does.
Then we have to scale the drawing view 1:1. Finnaly, we have to
export it as a DXF to a directory called N:\DXF.
This process is very cumbersome, expecially when you have 20+ drawings
to do this to. So that brings me to my first question. Im not very
knowledgable of the sheetmetal laser market, so if the process we are
using is the "old" way of doing things, maybe thats why SolidWorks
doesnt have an easy way to export flatpatterns for manufacturing.
If anyone has any suggestions/comments, please feel free to post a
reply. Thanks.
Ben
"SW Monkey" <google.50.s...@spamgourmet.com> wrote in message
news:aedbc5c7.03070...@posting.google.com...
"SW Monkey" <google.50.s...@spamgourmet.com> wrote in message
news:aedbc5c7.03070...@posting.google.com...
From API help...
retval = DrawingDoc.CreateFlatPatternViewFromModelView2 ( modelName,
configName, locX, locY, locZ, hideBendLines )
Input: (BSTR) modelName Name of model
Input: (BSTR) configName Name of configuration
Input: (double) locX X coordinate
Input: (double) locY Y coordinate
Input: (double) locZ Z coordinate
Input: (VARIANT_BOOL) hideBendLines TRUE hides bend lines, FALSE does not
--Mark
"SW Monkey" <google.50.s...@spamgourmet.com> wrote in message
news:aedbc5c7.03070...@posting.google.com...
Create a template drawing file with several pages:
Page 1) Shows development of each profile, with each dimension and
angle. This is used for bending the part
Page 2) Proof sheet. This is used to dimension the part exactly as the
customer has dimensioned it to assure that they are the same.
Page 3) Flat pattern: Scale 1:1, no annotation. This is the page to
output for CAM.
Pages are added or removed as required. If you just want to export
DXF, add a sheet to the drawing file with no format and scaled 1:1.
Place your flat pattern there and export.
google.50.s...@spamgourmet.com (SW Monkey) wrote in message news:<aedbc5c7.03070...@posting.google.com>...
google.50.s...@spamgourmet.com (SW Monkey) wrote in message news:<aedbc5c7.03070...@posting.google.com>...
"Mark Reimer" <mereimerR...@engineer.com> wrote in message news:<bec184$3eaiv$1...@ID-131937.news.dfncis.de>...
'
****************************************************************************
**
' CutPattern.swp macro last edited on 07/10/03 by Mark Reimer
'
****************************************************************************
**
Dim swApp As Object
Dim Drawing As Object
Dim Model As Object
Dim Annotation As Object
Dim Sheet1 As Object
Dim View As Object
Dim ModelName As String
Dim Sketch As Object
Dim pAnnotation As Object
Sub main()
Dim Errors As Long
Dim Warnings As Long
Dim ModelExtension As String
Set swApp = CreateObject("SldWorks.Application")
Set Drawing = swApp.ActiveDoc
If Drawing Is Nothing Then
MsgBox ("Unable to attach to active document.")
Exit Sub
End If
If Drawing.GetType <> swDocDRAWING Then
MsgBox ("This macro only works with drawings.")
Exit Sub
End If
Set View = Drawing.GetFirstView 'The first view is the sheet
If View Is Nothing Then
MsgBox ("Unable to get sheet view.")
Exit Sub
End If
Set View = View.GetNextView ' The next view is actually the first model view
If View Is Nothing Then
MsgBox ("Unable to get model view.")
Exit Sub
End If
ModelName = View.GetReferencedModelName ' Get the model file name referenced
by the view
ModelExtension = Right(ModelName, 3) ' Get last 3 extension chars to
determine model type
If View.IsModelLoaded = False Then View.LoadModel 'if model is not loaded,
then load it
If UCase(ModelExtension) = "ASM" Then 'open the assembly silently to get
model object
Set Model = swApp.OpenDoc6(ModelName, swDocASSEMBLY,
swOpenDocOptions_Silent, "", Errors, Warnings)
ElseIf UCase(ModelExtension) = "PRT" Then 'open the part silently to get
model object
Set Model = swApp.OpenDoc6(ModelName, swDocPART,
swOpenDocOptions_Silent, "", Errors, Warnings)
End If
If Model Is Nothing Then 'If the model cannot be opened, then exit without
doing anything
MsgBox ("CutPattern Macro could not get model object.")
Exit Sub
End If
'Add the new sheet and name it
' Format: retval = DrawingDoc.NewSheet3 ( name, paperSize, templateIn,
scale1, scale2, firstAngle, templateName, width, height, propertyViewName )
If Drawing.NewSheet3("CutPattern", swDwgPaperAsize, swDwgTemplateNone, 1, 1,
0, "", 0.4318, 0.2794, "Default") = False Then
MsgBox ("CutPattern Macro could not create drawing sheet")
Exit Sub
End If
'Find out if the model is a sheet metal part
If Model.GetBendState = swSMBendStateNone Then 'model is not a sheet metal
part
Drawing.CreateDrawViewFromModelView ModelName, "*Front", 0.215, 0.135, 0
'Go with Front view if no Flat Pattern exists
Else ' model is a sheet metal part
Drawing.CreateFlatPatternViewFromModelView2 ModelName, "", 0.215, 0.135,
0, True 'insert a Flat Pattern view
End If
Drawing.ViewZoomtofit2 'Zoom to fit view on screen
'Get the newly inserted view
Set View = Drawing.GetFirstView
Set View = View.GetNextView
View.SetDisplayMode (swHIDDEN) 'Set view to "Hidden lines removed" (HLR)
View.SetDisplayTangentEdges2 (swTangentEdgesHidden) 'Set view to "Tangent
edges removed"
'Delete all annotations and hide cosmetic threads
Drawing.ClearSelection 'Clear all current selections
Dim gotsomething As Boolean 'initialize variable
gotsomething = False
Set pAnnotation = View.GetFirstAnnotation ' Get the first Annotation in the
View if any exist
' Loop through every Annotation in View
While (Not pAnnotation Is Nothing) 'If pAnnotation is nothing, then to
annotation was selected this time
gotsomething = True 'An annotation was found at pAnnotation.GetNext or
View.GetFirstAnnotation
pAnnotation.Select2 True, 0 'Add the gotten annotation to the selection
list
If pAnnotation.GetType = swCThread Then 'If annotation is a cosmetic
thread, then hide it
Drawing.HideCosmeticThread
End If
Set pAnnotation = pAnnotation.GetNext 'Get the next annotation
Wend
If gotsomething = True Then
Drawing.EditDelete 'delete any annotations that may have been selected
End If
End Sub
"SW Monkey" <google.50.s...@spamgourmet.com> wrote in message
news:aedbc5c7.03071...@posting.google.com...
"Ray Reynolds" <rrey...@riconcorp.com> wrote in message news:<5NeOa.57486$926.6884@sccrnsc03>...
Could you email me the actual macro file again? The above email
address isnt good, try this one SLDWX.25.s...@spamgourmet.com.
Thanks.
"Mark Reimer" <mereimerR...@engineer.com> wrote in message news:<bek9g8$5v2ml$1...@ID-131937.news.uni-berlin.de>...
I wrote my own DXF exporter, which accesses the geometry directly from
the view.
This allows me to ignore all BUT the geometry (no bend lines, datum
point, center marks, etc) and the scale issue is irrelevant (except
for translating the default mm API units to inch). I also wrote
exporters for our sheet metal application formats (Fabriwin .prt files
and Maker .prt files) so I have the option of exporting directly to
CAM.
There are a few issues which I dont see addressed in most sheet metal
export schemes:
1) The CreateFlatPatternViewFromModelView API call still returns TRUE
if the VIEW was successfully created, and not *necessarily* the flat
pattern. This means that if the part has errors and wont unfold,
you'll generate nothing but a view of the folded state. I do a rebuild
on the referenced configuration and check the return for errors first.
2) If the model has an older style, non-derived flat pattern
configuration,
(which isnt linked to a 'folded' config), a call to generate a flat
pattern view will still use the old config, even on newer installs of
SW. The features
on these non-derived flat configs are sometimes not updated with its
folded view
and you can then end up exporting the OLD version of the part.
So generally, I first check to see if the config is derived, and, if
not, check to see if any special features have been added AFTER the
flat pattern/process bends feature. If there are none, then Id have
the code delete this legacy flat config and create a new derived
config, using the same naming scheme.
I use fabriwin myself, but for a laser. While Ive seen some
proprietary Plasma formats, normally G-Code can be very standard.
>> Fabriwin has an OLE integration to SolidWorks
>>It takes the open part unfolds it if it needs to be unfolded
Yes, well, I avoid that at all costs. First off, it fails if the part
has a Flat Pattern feature instead of the 'process bends' feature.
Secondly, fabriwin
only uses single-precision decimals internally in its format, and on
slight angles and/or non-quadrant arcs, the floating point returns
round off errors that create failures in nesting/common cutting, at
least when using the higher-precision needed for laser.
The easiest way to make this work is while in the VB editor editing this
macro, select File, Import File from the main menu and browse for
swConst.bas. It should be found in the SolidWorks\samples\appComm folder.
If you did already import it then I'm not sure what the problem is, but I
will resend the original macro to you again at your newer address before it
also expires.
--Mark
We're now primarly using N-cell for nesting. This also requires clean
dxf's for the tool path.
I do a saveas from my SW drawing, highlighting the flat pattern view.
First turn off sketches, so the bend lines disappear. In the saveas
dialog, select dxf, then go to options to set the scale to 1:1.
Then I load the file into Autocad LT, copy and move the flat view, cut
the rest of the drawing, and double check that the scale is correct.
This sounds like a lot of work, but probably only takes 15 seconds.
We've done hundreds this way since changing to Ncell, with almost no
trouble.
If you just do a "Hide Sketches" in the pull-down menu, it doesnt
truly hide the bend line, you can see this by moving your mouse over
where the bend line should be. Marks macro hides this though, works
great.
> Then I load the file into Autocad LT, copy and move the flat view, cut
> the rest of the drawing, and double check that the scale is correct.
Why not just delete the titleblock inside of SolidWorks? This would
save you from opening it in Autocad.
> This sounds like a lot of work, but probably only takes 15 seconds.
> We've done hundreds this way since changing to Ncell, with almost no
> trouble.
The procedure we use doesnt take that long either, about 10-15
seconds, but the more steps you have to do, the greater the chance of
an error. Checkout Marks macro he posted. It looks like it works
very well.