Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating and importing into a CatPart and CatProduct the Properties via CatScript

Status
Not open for further replies.

wmFLIPPER

Mechanical
Feb 18, 2006
32
0
0
US
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



 
Replies continue below

Recommended for you

Thanks for the reply,
Yes I did. Many times. But the search responds to what is entered.
I may not be using the correct terms to give me what I need.
I will try again. Did you find something?
 
Thank you again for those examples.
I copied them and tried them and they are not producing what I need at the moment.
I am just lacking and need to add info into the description field and revision.
Thank you for your help....


2020-09-09_14-55-39_j5vwba.jpg
 
Status
Not open for further replies.
Back
Top