Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub CATMain()
Dim oPartDoc As Part
On Error Resume Next
Set oPartDoc = CATIA.ActiveDocument.Part
If Err.Number <> 0 Then
Message = MsgBox("Sorry, This script works with a CATPart as Active document", vbCritical, "Error")
Exit Sub
End If
' What do you want to select
Dim EnableSelectionFor(0)
EnableSelectionFor(0) = "HybridBody"
' Reset the Selection
Set sSEL = CATIA.ActiveDocument.Selection
sSEL.Clear
' Define Selection
MsgBox "Please Select the Geometrical Set where you have the points"
UserSelection = sSEL.SelectElement2(EnableSelectionFor, "Please select another Geometrical Set", False)
' Evaluation if the selection is correct or not
If UserSelection <> "Normal" Then
MsgBox "Error with the selection"
Exit Sub
Else
Set ohybridbody = sSEL.Item(1).Value
End If
Set partDocument1 = CATIA.ActiveDocument
Dim selection1 As Selection
Set selection1 = partDocument1.Selection
selection1.Search "CATPrtSearch.Point,sel"
REM Set visPropertySet1 = selection1.visProperties
REM VisPropertySet1.SetShow 1
'''''''''''''''''''''''''''''''
Dim part1 As Parts
Set part1 = partDocument1.Part
Dim selection As Selection
Set selection = Catia.ActiveDocument.Selection
Dim hybridShapeFactory1 As HybridShapeFactory
Set hybridShapeFactory1 = part1.HybridShapeFactory
Dim Obj As VispProperties
Set Obj = Selection.VisProperties
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
visProperties1.SetLayer catVisLayerNone, None
REM selection1.Clear
Part1.Update
Dim specsAndGeomWindow1 As Window
Set specsAndGeomWindow1 = CATIA.ActiveWindow
Dim viewer3D1 As Viewer
Set viewer3D1 = specsAndGeomWindow1.ActiveViewer
Dim viewpoint3D1 As Viewpoint3D
Set viewpoint3D1 = viewer3D1.Viewpoint3D
viewer3D1.Reframe
Set viewpoint3D1 = viewer3D1.Viewpoint3D
Set body1 = Bodies1.Item("PartBody")
Part1.InWorkObject = Body1
'run another catscript
Dim EmptyPar()
Dim ScPath
ScPath = "C:\temp\"
CATIA.SystemService.ExecuteScript scpath, catScriptLibraryTypeDirectory, "LineNormalToSurface.CATScript", "CATMain", EmptyPar
End Sub