Hallo fireman,
anbei ein Auszug aus der Automation-Doku:
Func CreateProgram( CATBSTR iName, CATBSTR iComment, CATBSTR iProgramBody) As CATIAProgram
Creates a program relation and adds it to the part's collection of relations.
Parameters:
iName - The program name
iComment - A description of the program
iProgramBody - The program definition
Returns:
The created program
Example:
This example creates the selectdepth program relation and adds it to the newly created part:
Dim CATDocs As Documents
Set CATDocs = CATIA.Documents
Dim partdoc As Document
Set partdoc = CATDocs.Add("CATPart")
Dim part As Part
Set part = partdoc.Part
Dim depthProgram As Program
Set depthProgram = part.Relations.CreateProgram("selectdepth", "Select depth with respect to mass", "if (mass>2kg) { depth=2mm } else { depth=1 mm }")
Gruss
Steffen
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP