×
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

Relations.CreateFormula failure

Relations.CreateFormula failure

Relations.CreateFormula failure

(OP)
We recently went from v5r11sp4 to v5r13sp2 and the hybridbodies named "Open_body.1" were changed to "Geometrical Set.1".  Now the Releations.CreateFormula function fails to give the correct value and I suspect it has to do with the blank character in the name.  If you rename it in the CATIA file and the VB source module without the space it works "GeometricalSet.1"

This fails, gives length = zero:

Set myLenRel = myPart.Relations.CreateFormula("LenForm",
    "",myLength,"length(Geometrical Set.1\MySpline)")

Any ideas how to get the length of a spline when there is a space somewhere in the name?  Thanks!

RE: Relations.CreateFormula failure

Try using a split command on the name looking for a space.
Then append the two strings back together and you will get a new name without the space.

RE: Relations.CreateFormula failure

or try wrapping the name with the single quotes ``
(Note, not '')

RE: Relations.CreateFormula failure

(OP)
Not clear to me how to respond to the people who responded to my question.  Anyway, thank you.  I had already tried many combinations of single and double quotes to no avail, but yo and behold the tick marks worked! Again, thanks for the responding to my original question.

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