×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

catiaV5 vb formula for point on curve

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.
 

RE: catiaV5 vb formula for point on curve

So you have a curve and you want to have a macro which will create a new point on the curve whose location is determined by a parameter which has already been inputed, correct? Just want to make sure I understand the situation.

http://excelspreadsheetshelp.blogspot.com - http://scripting4v5.com

RE: catiaV5 vb formula for point on curve

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

RE: catiaV5 vb formula for point on curve

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

http://excelspreadsheetshelp.blogspot.com - http://scripting4v5.com

RE: catiaV5 vb formula for point on curve

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

RE: catiaV5 vb formula for point on curve

(OP)
no idea?

RE: catiaV5 vb formula for point on curve

Function CreateFormula (iName As String, iComment As String, iOutputParameter As Parameter, iFormulaBody As String)

Maybe try adding:

Dim strFormula As String
strFormula = strNameLength
CreateFormula("","",oParamLength,strFormula)

http://excelspreadsheetshelp.blogspot.com - http://scripting4v5.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources