How do you zero flattened sheet metal on drawing?
How do you zero flattened sheet metal on drawing?
(OP)
I have my sheet metal part designed in SolidWorks that needs to be converted into a DXF to be read into the machine for production. Currently I take the model, make a drawing of it displaying only the flat pattern and then covert that into a DXF. My question is this - is there any way to set the bottom left corner of the flat pattern window so that it sits exactly at the bottom left corner of the drawing sheet? Reason being - if that can be done I would not have to set my 0,0 point each time I load the DXF into the machine.
Thanks in advance.
Thanks in advance.






RE: How do you zero flattened sheet metal on drawing?
Regards,
Scott Baugh, CSWP
www.scottjbaugh.com
FAQ731-376
RE: How do you zero flattened sheet metal on drawing?
Any ideas
Matt
Electro Industries, Inc.
RE: How do you zero flattened sheet metal on drawing?
RE: How do you zero flattened sheet metal on drawing?
RE: How do you zero flattened sheet metal on drawing?
1. Place a sketch point of some sort in the drawing view of interest, constraining it to be at the desired 0,0 point of the part
2. Select this point and run the macro.
The macro would have the following steps:
1. Determine sheet x/y of the selected point
2. Determine SW's x/y location of the view on the sheet
3. Move view by amount of x/y coordinates of the point
4. Lock view position
5. (Optional?) Hide sketch point so it doesn't export
Of course, if the model's origin is not at the desired 0,0 point then the macro will have to be run again immediately prior to export.
RE: How do you zero flattened sheet metal on drawing?
CODE
Dim swDoc As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim myNote As SldWorks.Note
Dim myAnnot As SldWorks.Annotation
Dim SelMgr As SldWorks.SelectionMgr
Dim myView As SldWorks.View
Dim myDwgDoc As SldWorks.DrawingDoc
Dim CurViewPos As Variant
Dim PointPosOnSheet As Variant
Dim mySelData As SldWorks.SelectData
Sub main()
Set swApp = Application.SldWorks
Set swDoc = swApp.ActiveDoc
Set myDwgDoc = swDoc
Set myView = myDwgDoc.ActiveDrawingView
CurViewPos = myView.Position
Set SelMgr = swDoc.SelectionManager
Set mySelData = SelMgr.CreateSelectData
If SelMgr.GetSelectedObjectType3(1, -1) <> 11 Then
MsgBox "Select a sketch point and run macro again"
Exit Sub
End If
'This seemed like the easiest way to get location
'of the point in sheet space
Set myNote = swDoc.InsertNote("DummyText")
If Not myNote Is Nothing Then
myNote.Angle = 0
boolstatus = myNote.SetBalloon(0, 0)
PointPosOnSheet = myNote.GetAttachPos
Set myAnnot = myNote.GetAnnotation
myAnnot.Select3 False, mySelData
swDoc.EditDelete
Else
MsgBox "Failed to create note for some reason"
Exit Sub
End If
CurViewPos(0) = CurViewPos(0) - PointPosOnSheet(0)
CurViewPos(1) = CurViewPos(1) - PointPosOnSheet(1)
myView.Position = CurViewPos
swDoc.ClearSelection
swDoc.WindowRedraw
End Sub
RE: How do you zero flattened sheet metal on drawing?
This also allowed me to output a more compatible dxf (no Header section, etc) that some CAM packages choke on.