Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

catiaV5 vb formula for point on curve

Status
Not open for further replies.

fab51100

New member
Mar 7, 2012
4
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.
 
Replies continue below

Recommended for you

yes exactly, I managed to apply the length parameter at my point but there is no link.
I would like to create a relation (formula) between the parameter and the point.
thanks.
 
Are you dealing with a part or a product file?

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(...)

-
 
I work in a part
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor