Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Part.ViewDispHideAll ??? SWAPI question

Status
Not open for further replies.

SWVB101

Mechanical
Jun 25, 2003
85
In SolidWorks (SW01+)...
If you record a macro and click:
View>Hide All Types

Then open the macro, it shows this command:
Part.ViewDispHideAll

But if you try to use that command in a VB program (or even try to run the macro that you recorded), it says that the command does not exist (object does not support the method)

If you open up the API help file it lists the following methods:
ViewDispOrigins
ViewDispRefaxes
ViewDispRefplanes
ViewDispRefPoints
ViewDispTempRefaxes


But those do not include sketches or several other types...

Is there a workaround for this, or am I just doing something wrong, or What ???

I need to hide all sketches, origins, axes, and everything but the Actual Model Geometry.

The reason is... I am trying to write a program to automate converting (Sheet Metal) Part Models to DXF drawings to use to nest parts for NC Programming

Basically I open a Part file, create a blank DrawingDoc, and create a view with a command such as:
Drawing.CreateFlatPatternViewFromModelView2 _
ModelName:=Part.GetTitle, _
configName:=Part.GetActiveConfiguration().Name, _
locX:=0, _
locY:=0, _
locZ:=0, _
hideBendLines:=True


Which creates the flat pattern view of a model

Then I tried adding this to hide the other types...
Drawing.ViewDispHideAll

The others commands work, but they toggle the current state of each type. So if you say:
Drawing.ViewDispOrigins
Drawing.ViewDispRefaxes
Drawing.ViewDispRefplanes
Drawing.ViewDispRefPoints
Drawing.ViewDispTempRefaxes

some types might actually get turned on instead of off.

Any help on this would be MUCH appriciated.

Thanks,
Josh

When dealing with computers, there are 10 things you need to know: one, zero, and the rest is Binary.
-Josh S

 
Replies continue below

Recommended for you

I guess you could do this:
Code:
Private Sub HideAllTypes(Drawing As Object)
  With Drawing
    .SetUserPreferenceToggle 4, False   'Axes
    .SetUserPreferenceToggle 5, False   'Planes
    .SetUserPreferenceToggle 6, False   'Origins
    .SetUserPreferenceToggle 7, False   'Temp Axes
    .SetUserPreferenceToggle 13, False  'Coordsys
    .SetUserPreferenceToggle 19, False  'Ref Pnts
  End With
End Sub

I forgot about that command... (oops)

But that still does not hide the sketches...

When dealing with computers, there are 10 things you need to know: one, zero, and the rest is Binary.
-Josh S

 
I've got a program we wrote to do just that. Right now, we are releasing it under a pilot program. Let me know if you are interested.

Evan T. Basalik, MCSD
--------------------------------
It's all about prioritization...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor