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 documents1 = CATIA.Documents
for i=1 to CATIA.Documents.count
Set partDocument1 = documents1.item(i)
if typename(partDocument1)="PartDocument" then
Set product1 = partDocument1.Product
Set parameters1 = product1.UserRefProperties
Set part1 = partDocument1.Part
Set parameters2 = part1.Parameters
Set strParam2 = parameters2.Item("Material")
Err.Clear
On Error Resume Next
Set strParam1=parameters1.Item("Material")
errNumber = CLng(Err.Number)
if errNumber <> 0 then
Set strParam1 = parameters1.CreateString("Material", strParam2.Value)
else
strParam1.valuatefromstring(strParam2.Value)
end if
Err.Clear
On Error Resume Next
Set dimension1 = parameters1.Item("Mass")
errNumber = CLng(Err.Number)
if errNumber <> 0 then
Set dimension1 = parameters1.CreateDimension("Mass", "MASS", 0.000000)
dimension1.ValuateFromString Cstr(1000000*product1.analyze.mass)&"mg"
else
dimension1.ValuateFromString Cstr(1000000*product1.analyze.mass)&"mg"
end if
end if
next
End Sub
product1.analyze.mass
I wonder is there any way to link this mass to the drawing document parameter named "weight" which in-turn will link back to a text in background as an attribute link.
Also,
How to create external properties using macro and add a relation between them, I mean two different documents.(could u make an example and show for better clarity.)
3. User will link this drawing parameter "Weight" with the "Mass" of part parameter through f(x) dialog box.