Hide the Thread Display in a MEP by Macro

Hello

 

In order to automate the plane cleaning in order to make a dxf, I am looking for a macro to be able to hide all the thread representations on a plane as well as all the dimensions. (for the quotes I recorded a macro but it doesn't always work)

Then, thanks to integration, I would automatically replace the basemap with a blank basemap and could therefore automate the transformation of my dxf into batches.

For your information, if I don't use the function saved the part in dxf, it's because for stainless steel I have to choose the face of my cutout according to the plastic protection.

If anyone has an idea to hide these famous thread representations, I'm all for it.

Thank you

 

Hello

Here's a macro that may need to be adapted that does the same thing:

https://forum.solidworks.com/servlet/JiveServlet/download/220903-67734/DXF-Laser.swp.zip

 

Source: https://forum.solidworks.com/thread/43458

 

By searching we ended up finding with a colleague it was enough to go to the options of the document and hide the representation of threading)

Here's the macro for those who are interested

 

Dim swApp As Object

Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long

Sub main()

Set swApp = _
Application.SldWorks

Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("Sheet1", "SHEET", 0, 0, 0, False, 0, Nothing, 0)
Part.EditTemplate
Part.EditSketch
Part.ClearSelection2 True
boolstatus = Part.Extension.SketchBoxSelect("-0.022056", "0.310342", "0.000000", "0.226194", "-0.007816", "0.000000")
Part.EditDelete
Part.EditSheet
Part.EditSketch
boolstatus = Part.Extension.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCosmeticThreads, 0, False)
boolstatus = Part.Extension.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayFeatureDimensions, 0, False)
boolstatus = Part.Extension.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayReferenceDimensions, 0, False)
End Sub

 

1 Like

Is it possible to put the macro in a text file?

Because some lines are too long and appear with "... " at the end.