Reply
Solved! Go to solution

SE C# API Draft, Need to hide hiden edges, Defaults_ShowHiddenEdges

Hello

 

Im having problem in draft enviroment.

I am trying to hide hidden edges in draft view, with this code without any success.

 

drawingView = drawingViews.Item(2); 

drawingView.Defaults_ShowHiddenEdges = false;
drawingView.ShowEdgesHiddenByOtherParts = false;

 

its updated after this, but no change.

 

I have checked with debugging that these variables are actually changed, but has no affect in drawing views.

I have checked that these variables are from correct view.

 

Any idea what going wrong?

6 REPLIES

Re: SE C# API Draft, Need to hide hiden edges, Defaults_ShowHiddenEdges

To be fair, this was not obvious to me either. It took me a good 30 minutes to figure it out. The ModelMember class has a HiddenEdgeStyleName property. Setting this to 'Hidden' will hide the edges for that particular member. I am not seeing any way to set it at a higher level like the DrawingView itself, which would make sense IMHO.

 

SpyHiddenEdges.jpg

Jason Newell
Applications Architect
www.jasonnewell.net

Re: SE C# API Draft, Need to hide hiden edges, Defaults_ShowHiddenEdges

Hello

 

Sorry did not help in my case.

 

Here is picture of this problem,

Cutaway view need to be cleaned by takin hidden edges off.

prob.png

 

Re: SE C# API Draft, Need to hide hiden edges, Defaults_ShowHiddenEdges

I think that the Defaults_ShowHiddenEdges property is only used for new ModelMembers in the DrawingView. To change the visibility of hidden edges in any existing drawing, you need to change the ShowHiddenEdges property of all existing ModelMembers.

In the following sample code, I change the ShowHiddenEdges only for the DesignModel in any SectionView on the active sheet.

For assembly drawings, you might need to adopt the "if" condition to hide the hidden edges only on assembly components.

    '----------------------------------------------------------------------
    ' DFT: Hide the "hidden" edges in all section views
    '----------------------------------------------------------------------
    Dim objDoc As SolidEdgeDraft.DraftDocument = objApp.ActiveDocument
    Dim objSheet As SolidEdgeDraft.Sheet = objDoc.ActiveSheet
    For Each objDrawView As DrawingView In objSheet.DrawingViews
      If objDrawView.DrawingViewType = SolidEdgeDraft.DrawingViewTypeConstants.igXSectionView Then
        ' Set the default, so that any new model member in this section view will display correctly
        objDrawView.Defaults_ShowHiddenEdges = False
        ' As the drawing was generated from a Part document, only one ModelMember for the document exists
        Dim objDocMember As ModelMember = objDrawView.ModelMembers.Item(1)
        For Each objMember As ModelMember In objDocMember.ModelMembers
          ' For part drawing, we may only look for the design model (=SolidBodyMember)
          ' For assembly drawing, we may need to check for more component types
          If objMember.ComponentType = ModelMemberComponentTypeConstants.seSolidBodyMemberType Then
            objMember.ShowHiddenEdges = False
          End If
        Next
        'objDrawView.Update() ' You may need to force the update of the view
      End If
    Next

Re: SE C# API Draft, Need to hide hiden edges, Defaults_ShowHiddenEdges

Ok, does not work for me.

 

sectionView.Defaults_ShowHiddenEdges = false;

sectionView.Update();

Does not work...

 

Then I tryed this:

 

sheet.DrawingViews.Item(1).Defaults_ShowHiddenEdges = false;
sheet.DrawingViews.Item(2).Defaults_ShowHiddenEdges = false;

sheet.DrawingViews.Item(1).Update();
sheet.DrawingViews.Item(2).Update();

 

Does not work..

 

Is there some how I'm using these wrong??

Solution
Solution
Accepted by topic author jsskangas
‎10-12-2016 06:30 AM

Re: SE C# API Draft, Need to hide hiden edges, Defaults_ShowHiddenEdges

You have to set the ShowHiddenEdges property of each ModelMember individually!

See the sample code in my previous post.

Re: SE C# API Draft, Need to hide hiden edges, Defaults_ShowHiddenEdges

Hello

 

I did got wrong way, I was trying to hide edges from particular view.

And it works other way around, you need to hid edges from member of of view.

 

Thanks.