Pages

Wednesday, November 28, 2012

Scripting in Catia: Using Knowledge Patterns

Using Knowledge patterns in the way described in this tutorial allows for more of a scripting workflow within a single part. This eliminates the need for multiple part files and a catalog file.





 let vcrvs (VCrvUDF)
let i (integer)
let pt (point)
let spacing (length)
let num (length)
let ratio (real)

spacing = Vspacing

num = int(length (VCrvConstruction\Input\Line.1 )/spacing)

ratio = 1/num

for i while i < num
{
pt =pointoncurveRatio(VCrvConstruction\Input\Line.1 ,`00FrameworkSketch\Point.3` ,i*ratio,true)
vcrvs=CreateOrModifyTemplate("VCrvUDF" ,VCurves ,`Relations\Knowledge Pattern.5\VCrvsList` ,i)
vcrvs.xyplane =xyplane
vcrvs.Point.7 =pt
vcrvs.MultisectionsSurface.1 =`VCrvConstruction\Input\Multi-sections Surface.1`
EndModifyTemplate(vcrvs)
i = i + 1
}




 

No comments:

Post a Comment