×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How do you zero flattened sheet metal on drawing?

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.

RE: How do you zero flattened sheet metal on drawing?

in a drawing the 0,0 is set to the lower left corner already. When you export the file what are you scaling the sheet of the view?

Regards,

Scott Baugh, CSWP
www.scottjbaugh.com
FAQ731-376

RE: How do you zero flattened sheet metal on drawing?

I've ran into the same problem, but never found a solution. I think that what dmeyers is trying to do is make sure the bottom-most and left-most edges are coincident with the 0,0 of the drawing for export to .dxf so that CNC software has no offset when nesting. I have an a-sized sheet where I put a flat pattern view with (Hide All Types) that I export to DXF 1:1 and have to re-open in AutoCad (because DWGEditor isn't as much fun to use) and align with the 0,0.

Any ideas

Matt
Electro Industries, Inc.

RE: How do you zero flattened sheet metal on drawing?

I don't think there's an easy way to line your model edges up with the sheet origin.  I think this could be done with a macro if you do it often.  If it's only on occasion then I would bite the bullet and do it in DWGEditor or ACAD.

RE: How do you zero flattened sheet metal on drawing?

(OP)
ElectroMatt is correct.  I'm actually relaying this issue from a client of ours and it is something that they run into on a daily level.  Even with a macro how could you define the the edges are lined up perfectly if they are not selectable/defineable?

RE: How do you zero flattened sheet metal on drawing?

Without actually trying it myself, I would approach it as follows:

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?

Here's a starting point.  I couldn't find a way to lock view position through API.

CODE

Dim swApp As SldWorks.SldWorks
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?

What Ive done previously was to use a macro to parse the actual 2d entities out of the drawing view, and get a  "bounding box" for the entities.Then Id write my own dxf file, offseting the location of the entities by the lower left corner of the bounding box.

This also allowed me to output a more compatible dxf (no Header section, etc) that some CAM packages choke on.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources