Quick Tips: How to Hide Origin Element Planes

I’ve got a quick CATIA macro tip for you today. It’s always a good idea to clean up your model before submitting your design to your boss or customer for review. Most CAD designers will hide all the construction geometry, a time consuming task if all done by hand. Hiding elements in CATIA can easily be done with a CATScript, and today I’m going to show you how to hide the default planes.

how to hide origin planes in catia with a macro

‘Assumptions: a single CATPart is the active document

Sub HidePlanes()

Dim myPart As Part

Set myPart = CATIA.ActiveDocument.Part



Dim OriginElement, myPlaneZX, myPlaneXY, myPlaneYZ

Set OriginElement = myPart.OriginElements

Set myPlaneXY = OriginElement.PlaneXY

Set myPlaneYZ = OriginElement.PlaneYZ

Set myPlaneZX = OriginElement.PlaneZX



Dim RefmyPlaneXY As Reference

Set RefmyPlaneXY = myPart.CreateReferenceFromObject(myPlaneXY)

Dim RefmyPlaneYZ As Reference

Set RefmyPlaneYZ = myPart.CreateReferenceFromObject(myPlaneYZ)

Dim RefmyPlaneZX As Reference

Set RefmyPlaneZX = myPart.CreateReferenceFromObject(myPlaneZX)



Dim HS As HybridShapeFactory

Set HS = myPart.HybridShapeFactory

HS.GSMVisibility RefmyPlaneXY, 0

HS.GSMVisibility RefmyPlaneYZ, 0

HS.GSMVisibility RefmyPlaneZX, 0

myPart.Update



End Sub

There are other good CATPart final clean up codes found in my free email course (and you get my ten best macros just for joining).

 

2 Comments

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.