setting hidden line style on individual assembly occurrence in draft.

setting hidden line style on individual assembly occurrence in draft.

breinkemeyer
Enthusiast Enthusiast
1,146 Views
6 Replies
Message 1 of 7

setting hidden line style on individual assembly occurrence in draft.

breinkemeyer
Enthusiast
Enthusiast

I need to hide the hidden lines on just the screw flights on the attached drawing.  is this accomplished in the browser or can I do it an easier way.  C#, VB or VBA will work.

0 Likes
Accepted solutions (1)
1,147 Views
6 Replies
Replies (6)
Message 2 of 7

Ralf_Krieg
Advisor
Advisor

Hello

 

You can change the selection priority for drawings with the little pulldown in the quick access toolbar to part selection. After this, if you hover over the screw flights, all lines should be highlighted. Right click and click on "hidden lines" in the context menu.

Or you can test the iLogic rule below. Start it and pick one line (if the line has visible or hidden line style is not relevant) and the hidden lines will be set to invisible.

To reset the invisible lines, right click on an empty space of the drawing view and select "show hidden lines".

Dim oApp As Inventor.Application= ThisApplication
Dim oDrawDoc As DrawingDocument = oApp.ActiveDocument
Dim oDrawCurveSeg As DrawingCurveSegment= oApp.CommandManager.Pick(kDrawingCurveSegmentFilter, "Pick a line of the component")
Dim oDrawCurve As DrawingCurve= oDrawCurveSeg.Parent
Dim oDrawView As DrawingView = oDrawCurve.Parent
Dim oEdgeProxy As EdgeProxy= oDrawCurve.ModelGeometry
Dim oOcc As ComponentOccurrence = oEdgeProxy.ContainingOccurrence
Dim oDrawCurves As DrawingCurvesEnumerator = oDrawView.DrawingCurves(oOcc)

For Each oDrawCurve In oDrawCurves
    For Each oDrawCurveSeg In oDrawCurve.Segments
        If oDrawCurveSeg.HiddenLine = True Then
            oDrawCurveSeg.Visible = False
        End If
    Next
Next

 

 


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 3 of 7

breinkemeyer
Enthusiast
Enthusiast

Thanks for the reply.  I should have mentioned this app is running with no user input.

0 Likes
Message 4 of 7

Ralf_Krieg
Advisor
Advisor

Hello

 

Then you have to tell us how to unique identify the screw flights. Upload the model, tell us how the component is named in browser or something else. 😉


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 5 of 7

breinkemeyer
Enthusiast
Enthusiast

Files attached...

0 Likes
Message 6 of 7

Ralf_Krieg
Advisor
Advisor
Accepted solution

Hello

 

Thanks for the files. I picked the part "Flight" in the part name to identify the parts we need.

The script is not perfect, but works so far.

 

Option Explicit on

Dim oApp As Inventor.Application= ThisApplication
Dim oDrawDoc As DrawingDocument = oApp.ActiveDocument
Dim oAssDoc As AssemblyDocument= oDrawDoc.ReferencedDocuments(1) 'we assume there is only one
Dim oObjColl As ObjectCollection = oApp.TransientObjects.CreateObjectCollection

Dim oOccs As ComponentOccurrencesEnumerator
Dim oOcc As ComponentOccurrence
Dim oDrawView As DrawingView
Dim oDrawCurves As DrawingCurvesEnumerator
Dim oDrawCurve As DrawingCurve
Dim oDrawCurveSeg As DrawingCurveSegment
Dim oRefedDoc As Document

Dim oTrans As Transaction = oApp.TransactionManager.StartTransaction(oDrawDoc, "HideLines")

For Each oDrawView In oDrawDoc.ActiveSheet.DrawingViews
    If oDrawView.ViewType = DrawingViewTypeEnum.kStandardDrawingViewType Then
        For Each oRefedDoc In oAssDoc.AllReferencedDocuments
            If InStr(oRefedDoc.FullFileName, "Flight") Then
                oOccs = oAssDoc.ComponentDefinition.Occurrences.AllReferencedOccurrences(oRefedDoc)
                For Each oOcc In oOccs
                    oDrawCurves = oDrawView.DrawingCurves(oOcc)
                    For Each oDrawCurve In oDrawCurves
                        For Each oDrawCurveSeg In oDrawCurve.Segments
                            If oDrawCurveSeg.HiddenLine = True Then
                                oDrawCurveSeg.Visible = False
                            End If
                        Next
                    Next
                Next
                oDrawCurves = Nothing
            End If
            oOccs = Nothing
        Next
    End If
Next

oTrans.End


 


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 7 of 7

breinkemeyer
Enthusiast
Enthusiast

That got it, many thanks!

0 Likes