Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Checking in a drawing of an assembly some hiddenline for a part

1 REPLY 1
Reply
Message 1 of 2
patrick.fillion
267 Views, 1 Reply

Checking in a drawing of an assembly some hiddenline for a part

I am looking to check the hiddenline status of a part in a drawing. The drawing is made from an assembly. I dont want to take all the segments from the view and check for each of them. I want a way I can just grab the entities that are made from an occurence.

 

I was hopping to use the drawingcurve(modelobject), but I dont know what to use as the modelobject! is it the edge, edges, component definition... Here some of the code that is not working.

 

Dim _portePattern As OccurrencePattern = oassbly.ComponentDefinition.OccurrencePatterns.Item("Pattern Porte")
            Dim _PoigneeOcc As ComponentOccurrence
            Dim _PorteOcc As ComponentOccurrence
            Dim PatEle As OccurrencePatternElement
            Dim _poigneeDef As ComponentDefinition
            Dim _poigneeSFbody As SurfaceBody
            Dim _poigneeEdges As Edges


            For i As Integer = 1 To _portePattern.OccurrencePatternElements.Count
                PatEle = _portePattern.OccurrencePatternElements.Item(i)
                Debug.Print(i & "/" & _portePattern.OccurrencePatternElements.Count & "> " & PatEle.Name)
                _PorteOcc = PatEle.Occurrences(1)
                Debug.Print(_PorteOcc.Name)
                For Co As Integer = 1 To _PorteOcc.SubOccurrences.Count
                    Debug.Print(Co & "/" & _PorteOcc.SubOccurrences.Count & "> " & _PorteOcc.SubOccurrences.Item(Co).Name)
                    If _PorteOcc.SubOccurrences.Item(Co).Name.ToLower.Contains("poi") Then
                        _PoigneeOcc = _PorteOcc.SubOccurrences.Item(Co)
                        _poigneeEdges = _PoigneeOcc.Definition.SurfaceBodies(1).Edges
                        For Ed As Integer = 1 To _poigneeEdges.Count
                            Debug.Print(Ed & "/" & _poigneeEdges.Count)
                            
                            For Each dwgSeg As DrawingCurveSegment In _view.DrawingCurves(_poigneeEdges.Item(Ed))
                                If dwgSeg.HiddenLine = True Then
                                    dwgSeg.Visible = False
                                End If
                            Next
                        Next

                    End If
                Next

1 REPLY 1
Message 2 of 2
adam.nagy
in reply to: patrick.fillion

Hi there,

 

I think you could just pass in the occurrence to DrawingCurves() as is done in this sample code:

http://modthemachine.typepad.com/my_weblog/2010/10/changing-drawing-curves-to-match-assembly-color.h...

 

I hope this helps.

 

______________________________________________________________

If my post answers your question, please click the "Accept as Solution"

button. This helps everyone find answers more quickly!



Adam Nagy
Autodesk Platform Services

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report