Hi all,
I'll be honest up front and confess that I know little about Macros other than using them. We get a reasonable amount of laser cutting and water jet cutting done and like most, our drawings are sent in DXF format at 1:1. I currently use a macro that creates a scan sheet and populates it with all the items from the detailing sheet that are destined for the cutting process, the only gripe I have is that the imported instances do not re-scale to the scan sheet scale (1:1) but rather they come in with the scale of the detailing sheet where they were detected ,i.e. 1:5 or 1:10 etc etc. I've attached the aforementioned macro in the hope that one of you learned folk might be kind enough to examine and update to include the scale adoption and line weight change. The desired line weight is 1/10 or .1mm. I've also attaché a screen shot of my scan page to show the as created instance (left) and the desired result after scaling and line weight changes (right).
rgds
Harry
I don't have too much time so this is about only changing scale of a view.
I tried change a view's scale with this macro. It searches for every sheet and multiple every views' scale by 2. This isn't complete but you can manipulate variables and produce different results
Dim swApp As Object
Sub main()
Dim swmodel As SldWorks.ModelDoc2
Dim swdraw As SldWrosk.DrawingDoc
Set swApp = Application.SldWorks
Set swmodel = swApp.ActiveDoc
Set swdraw = swmodel
Dim sh As SldWorks.Sheet
Dim vi As SldWorks.View
Dim vivs As Variant
Dim shnames As Variant
shnames = swdraw.GetSheetNames
Dim say
say = 0
For i = 0 To UBound(shnames)
vivs = swdraw.Sheet(shnames(i)).GetViews
If say >= 1 Then GoTo saygec
say = say + 1
On Error Resume Next
For k = 0 To UBound(vivs)
Set vi = vivs(k)
MsgBox vi.Name
vi.ScaleDecimal = vi.ScaleDecimal * 2#
Next
saygec:
Next
End Sub