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.
Language="VBSCRIPT"
Sub CATMain()
Set Doc =CATIA.ActiveDocument ' Get current document
Set Part = Doc.Part ' Get the part
Set PartBody = Part.MainBody ' Grab the mainbody
PartBody.Name = "MAIN_BODY" ' Rename Body
'PartBody.Name = "PartBody" ' Rename Body
Set parameters1 = Part.Parameters
Set dimension1 = parameters1.CreateDimension("", "VOLUME", 0.000000)
dimension1.Rename "VOLUME"
Set relations1 = Part.Relations
Set formula1 = relations1.CreateFormula("Formule.1", "", dimension1, "smartVolume(`MAIN_BODY` ) ")
formula1.Rename "Formule.1"
Dim partDocument1 ''As Document
Set partDocument1 = CATIA.ActiveDocument
Dim part1 ''As Part
Set part1 = partDocument1.Part
Dim product1 ''As CATBaseDispatch
Set product1 = partDocument1.GetItem("MAIN_BODY")
Set product1 = product1.ReferenceProduct
Dim parameters1 ''As Parameters
Set parameters1 = product1.UserRefProperties
Dim realParam2 ''As RealParam
Set realParam2 = parameters1.CreateReal("volum", VOLUME)
realParam2.ValuateFromString VOLUME
Dim relations1 ''As Relations
Set relations1 = part1.Relations
Dim formula2 ''As Formula
Set formula2 = relations1.CreateFormula("Formula.5", "", realParam2, "VOLUME " )
formula2.Rename "Formula.5"
formula2.Update
partDocument1.Update
End Sub