×
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

Part.ViewDispHideAll ??? SWAPI question

Part.ViewDispHideAll ??? SWAPI question

Part.ViewDispHideAll ??? SWAPI question

(OP)
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

RE: Part.ViewDispHideAll ??? SWAPI question

(OP)
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

RE: Part.ViewDispHideAll ??? SWAPI question

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...

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