Reply
Solved! Go to solution

'Show edges hidden by other parts' option in API

Using the properties of a drawing view it is possible to hide or show the hidden lines with one click.

 

Using the API I cannot find this function.

 

I only way I can find is to loop through all the model members and change the property ‘SolidEgdeDraft.ModelMember.ShowEdgesHiddenByOtherParts = false’. However, in a large assembly it takes ages to loop through all the modelmembers. When I do it using the UI it is just one click and very fast.

 

Does somebody know how to do this in a fast way?

 

2 REPLIES

Re: 'Show edges hidden by other parts' option in API

I don't have time right this second to do any test code but a quick search in Spy for Solid Edge using keyword 'ShowEdge' found some promising properties. Take a peek and see if any help.

 

Jason Newell
Applications Architect
www.jasonnewell.net
Solution
Solution
Accepted by topic author woutersloof
‎08-26-2015 04:32 AM

Re: 'Show edges hidden by other parts' option in API

Hi Jason,

 

Thank you for your reply. I found the correct property which works.

 

There seems to be the property 'ShowEdgesHiddenByOtherParts', which seems to be the obvious one Smiley Wink. No idea why I didn't see it the first time. Shame on me..

 

This (piece of old fashion VBA) code works:

 

Public Sub Test()

Dim objApp As SolidEdgeFramework.Application
Dim objDoc As SolidEdgeDraft.DraftDocument
Dim objSheet As SolidEdgeDraft.Sheet
Dim objDrawingViews As SolidEdgeDraft.DrawingViews
Dim objDrawingView As SolidEdgeDraft.DrawingView

'Get SE en open goede document
    Set objApp = GetObject(, "SolidEdge.Application")

    If Err.Number = 91 Or Err.Number = 429 Then
        Err.Clear
        Set objApp = CreateObject("SolidEdge.Application")
    End If

'Set
    Set objDoc = objApp.ActiveDocument
    Set objSheet = objDoc.ActiveSheet
    Set objDrawingViews = objSheet.DrawingViews
    Set objDrawingView = objDrawingViews.Item(1)

'Do it
    objDrawingView.ShowEdgesHiddenByOtherParts = True
    objDrawingView.Update
    
'Clean up
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objSheet = Nothing
    Set objDrawingViews = Nothing
    Set objDrawingView = Nothing

End Sub

 

Thank for your help!