Toggle visibility of mesh features

Toggle visibility of mesh features

lukerietdyk
Enthusiast Enthusiast
2,349 Views
4 Replies
Message 1 of 5

Toggle visibility of mesh features

lukerietdyk
Enthusiast
Enthusiast

Hi all, the design office I work in has just updated from Inventor 2016 to 2020, which has most notably improved our ability to work with and consume parts that either contain, or are entirely made up of, mesh features. 

 

My question - is it possible to toggle the visibility of the mesh features of all the child parts, from within the top-level assembly? 

 

For example, an assembly I am working with may contain 100 parts, 80 of which contain both solid bodies and mesh features. Is there an out-of-the-box command (similar to View-Object Visibility-Construction Surfaces ), where I can hide every mesh feature in every child part/assembly in a single operation? The mesh feature is always an exact duplicate of the solid body in terms of shape etc.

 

The reason I want to be able to do this is two-fold:

- I want to be able to keep my Visual Style as "Shaded with Edges" (however in doing so, the graphics card has to work much harder to display the triangular facelets resulting in slower performance)

- I want to ensure any constraints made between parts are between the solid bodies, not the mesh by accident.

- I DONT want to have to edit each part individually to turn the mesh off

 

We receive and work with lots of third-party supplied files in JT format etc to use as reference geometry, which we then design around. We will implement ways of cleaner conversions in future to ensure mesh features are not imported if they are unnecessary, but for the short to medium term we have hundreds of thousands if not millions of files that contain both solid bodies and mesh features that we need to be able to work with efficiently.

 

I have turned the Help documentation and this forum upside down looking for a way to do this, but can't find one. I have attached some example images which I hope clarify the above.

 

If anyone knows how to do this, or has already developed ilogic or a macro that would do the same job, that would be much appreciated......

 

 

0 Likes
Accepted solutions (1)
2,350 Views
4 Replies
Replies (4)
Message 2 of 5

gcoombridge
Advisor
Advisor
Accepted solution

@lukerietdyk I just had the same issue with point clouds a few weeks ago. Ilogic is the only solution as far as I'm aware. Try this:

 

'This rule will iterate through all of the referenced document in the assembly and do something (i.e. turn off all sketchs as per the example in the rules browser)
'The difference between referenced docs and occurrences is that you may have 50 PLACED occurrences of the SAME referenced doc such as a bolt, nut , pump etc...
If ThisDoc.Document.DocumentType = KAssemblyDocumentObject Then

Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisDoc.Document
Dim oDoc As Inventor.Document

Dim oPartDoc As PartDocument
Dim oDef As PartComponentDefinition
Dim oMesh As MeshFeature

oVis = MsgBox("Do you want meshes visible?", MessageBoxButtons.YesNo, "Mesh Visibility")

For Each oDoc In oAsmDoc.AllReferencedDocuments
        Try
                If oDoc.DocumentType = KPartDocumentObject Then
					oPartDoc = oDoc
					oDef = oPartDoc.ComponentDefinition
					
						If oVis = vbYes Then
							For Each oMesh In oDef.MeshFeatureSets.Item(1)
								oMesh.Visible = True
							Next oMesh
						Else 
							For Each oMesh In oDef.MeshFeatureSets.Item(1)
								oMesh.Visible = False
							Next oMesh
						End If
				End If
					
        Catch
                'Do Nothing
        End Try
Next oDoc

Else
	MsgBox("This rule can only be run in an assembly document",,"Note")
End If

iLogicVb.UpdateWhenDone = True

Note it assumes there is only one 'MeshFeatureSet' in your part. This I believe is the browser node container for the mesh. If you have multiple meshes per part it will need some tweaking

 

 

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
Message 3 of 5

gcoombridge
Advisor
Advisor

Here's the point cloud one if its of use to anyone... (run from assembly as the previous rule)

 

'This rule will iterate through all of the referenced document in the assembly and do something (i.e. turn off all sketchs as per the example in the rules browser)
'The difference between referenced docs and occurrences is that you may have 50 PLACED occurrences of the SAME referenced doc such as a bolt, nut , pump etc...
If ThisDoc.Document.DocumentType = KAssemblyDocumentObject Then

Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisDoc.Document
Dim oDoc As Inventor.Document

Dim oPartDoc As PartDocument
Dim oDef As PartComponentDefinition
Dim oPC As PointCloud

oVis = MsgBox("Do you want point clouds visible?", MessageBoxButtons.YesNo, "PC Visibility")

For Each oDoc In oAsmDoc.AllReferencedDocuments
        Try
                If oDoc.DocumentType = KPartDocumentObject Then
					oPartDoc = oDoc
					oDef = oPartDoc.ComponentDefinition
					
						If oVis = vbYes Then
							For Each oPC In oDef.PointClouds
								oPC.Visible = True
							Next oPC
						Else 
							For Each oPC In oDef.PointClouds
								oPC.Visible = False
							Next oPC
						End If
				End If
					
        Catch
                'Do Nothing
        End Try
Next oDoc

Else
	MsgBox("This rule can only be run in an assembly document",,"Note")
End If
Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
0 Likes
Message 4 of 5

lukerietdyk
Enthusiast
Enthusiast

@gcoombridge  thank you Sir... this works perfectly and achieves exactly what we need. I've marked this as a solution, and think I might also add equivalent functionality as a suggestion for future releases. I don't think its unreasonable to expect the software to be able to do this out-of-the-box, but thats only my opinion. Thanks again!

Message 5 of 5

gcoombridge
Advisor
Advisor

@lukerietdyk I definitely agree, it should be under the view menu where you turn off work features... 

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
0 Likes