wmFLIPPER
Mechanical
- Feb 18, 2006
- 32
Hello all,
I need help and would like to Create and import into a CatPart and CatProduct the Properties with a catscript.
I believe I have the Creating part down and it works.
I just need to import into existing part properties like "Description" "Revision" some info
In that field will be my Notes for the drawing and so on.
I have been able to get this far with examples found on internet of others helping.
Yes, this is for being able to import into my drawings so the info is always taken the catpart.
My Catscript for the drawings works great.
Below is what I have so far and works.
Language="VBSCRIPT"
Sub catmain()
Dim partDoc As PartDocument
Set partDoc = CATIA.ActiveDocument
Dim partProd As Product
Set partProd = partDoc.Product
Dim prodProps As Parameters
Set prodProps = partProd.UserRefProperties
Dim newProp As Parameter
Set newProp = prodProps.CreateString("DRAWING TITLE", "")
Set newProp = prodProps.CreateString("TOOL DRAWING NO", "")
Set newProp = prodProps.CreateString("CUSTOMER NAME", "")
Set newProp = prodProps.CreateString("CUSTOMER PROJECT NAME", "")
Set newProp = prodProps.CreateString("CUSTOMER PART NO", "")
Set newProp = prodProps.CreateString("DESIGNED BY", "")
Set newProp = prodProps.CreateString("DESIGNED BY DATE", "")
Set newProp = prodProps.CreateString("DRAWN BY", "")
Set newProp = prodProps.CreateString("DRAWN BY DATE", "")
Set newProp = prodProps.CreateString("CHECKED BY", "")
Set newProp = prodProps.CreateString("CHECKED BY DATE", "")
Set newProp = prodProps.CreateString("MFG/ENG APPROVAL BY", "")
Set newProp = prodProps.CreateString("MFG/ENG APPROVAL BY DATE", "")
'Set newProp = prodProps.CreateString("MATERIAL", "")
'Set newProp = prodProps.CreateString("FINISH", "")
'Set newProp = prodProps.CreateString("HEAT TREAT", "")
If Mode = 1 Then
CATCheckRef = 0
Else
MsgBox "PROPERTIES CREATED FOR DRAWING! GO FILL THEM OUT!"
CATCheckRef = 1
End If
End Sub
I need help and would like to Create and import into a CatPart and CatProduct the Properties with a catscript.
I believe I have the Creating part down and it works.
I just need to import into existing part properties like "Description" "Revision" some info
In that field will be my Notes for the drawing and so on.
I have been able to get this far with examples found on internet of others helping.
Yes, this is for being able to import into my drawings so the info is always taken the catpart.
My Catscript for the drawings works great.
Below is what I have so far and works.
Language="VBSCRIPT"
Sub catmain()
Dim partDoc As PartDocument
Set partDoc = CATIA.ActiveDocument
Dim partProd As Product
Set partProd = partDoc.Product
Dim prodProps As Parameters
Set prodProps = partProd.UserRefProperties
Dim newProp As Parameter
Set newProp = prodProps.CreateString("DRAWING TITLE", "")
Set newProp = prodProps.CreateString("TOOL DRAWING NO", "")
Set newProp = prodProps.CreateString("CUSTOMER NAME", "")
Set newProp = prodProps.CreateString("CUSTOMER PROJECT NAME", "")
Set newProp = prodProps.CreateString("CUSTOMER PART NO", "")
Set newProp = prodProps.CreateString("DESIGNED BY", "")
Set newProp = prodProps.CreateString("DESIGNED BY DATE", "")
Set newProp = prodProps.CreateString("DRAWN BY", "")
Set newProp = prodProps.CreateString("DRAWN BY DATE", "")
Set newProp = prodProps.CreateString("CHECKED BY", "")
Set newProp = prodProps.CreateString("CHECKED BY DATE", "")
Set newProp = prodProps.CreateString("MFG/ENG APPROVAL BY", "")
Set newProp = prodProps.CreateString("MFG/ENG APPROVAL BY DATE", "")
'Set newProp = prodProps.CreateString("MATERIAL", "")
'Set newProp = prodProps.CreateString("FINISH", "")
'Set newProp = prodProps.CreateString("HEAT TREAT", "")
If Mode = 1 Then
CATCheckRef = 0
Else
MsgBox "PROPERTIES CREATED FOR DRAWING! GO FILL THEM OUT!"
CATCheckRef = 1
End If
End Sub