This week we used CATIA script and UDF protocols to create a very interesting array of curves along a surface.
To recap there were 3 main parts to this file. (i) create a design file with a surface derived from a shape and two points. (ii) create a udf file which utilized parameters and projected curves to a dead geometry (our surface from the first design file copy-special into the udf file). (iii) create a user-defined feature/definition, this is where scripting became involved (below is the actual code).
let d1(roofudfcurve)
let i (integer)
i=0
for i while i <= curvenumber
{
d1 = CreateOrModifyTemplate("roofdesign|roofudfcurve",CURVES ,`Relations\Knowledge Pattern.1\roofudfcurve` ,i)
d1.Surface = CONTEXT\Fill.1
d1.Line2 = CONTEXT\Line.2
d1.Line1 = CONTEXT\Line.1
d1.curvenumber = curvenumber - 1
d1.curveposition = i - 1
EndModifyTemplate(d1)
d1.Name = "CRV" + ToString(i)
We then applied this definition to the first design file and were apply to generate the various curves along the surface parameterically.
No comments:
Post a Comment