catiaV5 vb formula for point on curve
catiaV5 vb formula for point on curve
(OP)
Hi all,
I'm working on vba CatiaV5 and I have a problem,
I work in a part and I manage not to apply a formula for a "point on curve" created by automation.
The information to put in the formula is the length of a parameter previously created.
If anyone has an idea to help me.
thank you in advance.
Fabien.
I'm working on vba CatiaV5 and I have a problem,
I work in a part and I manage not to apply a formula for a "point on curve" created by automation.
The information to put in the formula is the length of a parameter previously created.
If anyone has an idea to help me.
thank you in advance.
Fabien.





RE: catiaV5 vb formula for point on curve
http://excelspreadsheetshelp.blogspot.com - http://scripting4v5.com
RE: catiaV5 vb formula for point on curve
I would like to create a relation (formula) between the parameter and the point.
thanks.
RE: catiaV5 vb formula for point on curve
If you're dealing with a part try starting with something like this:
Dim oPart As Part
Dim oParams As Parameters
Dim oParamLength As Parameter
Dim strNameLength As String
Set oPart = CATIA.ActiveDocument.Part
Set oParams = oPart.Parameters.RootParameterSet.DirectParameters
Set oParamLength = oParams.Item("LENGTH")
strNameLength = oParams.GetNameToUseInRelation(oParamLength)
And to use the relation in a formula:
Set oFormula = oPart.Relations.CreateFormula(...)
http://excelspreadsheetshelp.blogspot.com - http://scripting4v5.com
RE: catiaV5 vb formula for point on curve
I did that, but it is the code in brackets in the formula that I do not find.
I find this example for line (point,direction)on net:
Set Parm = parameters.CreateDimension("HelixHeight", "LENGTH", Height)
Set Point1 = PartDoc.part.HybridShapeFactory.AddNewPointCoord(X0, Y0, Z0)
myHBody.AppendHybridShape Point1
Dim Dir As Object
Set Dir = PartDoc.part.HybridShapeFactory.AddNewDirectionByCoord(A1, B1, C1)
Dim Line As Object
Set Line = PartDoc.part.HybridShapeFactory.AddNewLinePtDir(Point1, Dir, 0, HelixHeight, False)
myHBody.AppendHybridShape Line
Set Formula = relations.CreateFormula("Formula.0", "", Line.EndOffset, "HelixHeight")
but I arrive not to apply this principle for point on curve.
RE: catiaV5 vb formula for point on curve
RE: catiaV5 vb formula for point on curve
Maybe try adding:
Dim strFormula As String
strFormula = strNameLength
CreateFormula("","",oParamLength,strFormula)
http://excelspreadsheetshelp.blogspot.com - http://scripting4v5.com