I need a Macro

Feb 21, 2007 4 Replies

Hi every body,



I need a macros with following functionality


1) need to uncheck all the tabs in View pulldown menu except "Hide all types"


2) Need to hide all the userdefined Planes.


Please help me out....



2) This isn't exactly what you are looking for, but it's a starting place:
formatting link

Search for "ModelDoc2::SetUserPreferenceToggle" in the SolidWorks API- help.

Here's a little macro to show you how to use it. I copy/pasted it, 'cause I can't seem to find an attach button here. Not possible to attach files here??

------------------------------------------------ Dim swApp As Object Dim Part As Object Dim boolstatus As Boolean

Sub main()

Set swApp = Application.SldWorks Set Part = swApp.ActiveDoc

boolstatus = Part.SetUserPreferenceToggle(swViewDisplayHideAllTypes, True)

End Sub

------------------------------------------------

Also be aware that not all of the display types are controllable. =========================================================================== Chris

Try recording a macro. I tried it and got all the calls needed to do what you are asking.

Bagarnx there are no attachments on this NG

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required