×
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

Points in middle of curve

Points in middle of curve

Points in middle of curve

(OP)
Hi all

I'm trying to find a way of automating a way of picking a curve and placing a point in the middle of the curve. I'm pretty sure with a bit of macro knowledge this could be done this is what I am trying to achieve:

Create a intersection along a part body which I have then disassembled and placed all in geometrical set called 'intersection curves' because of the length of the part this is in the region of 2000 curves. I need to place a catia point in the middle of each of these curves to use for pt measurement on a CMM. The only way I know how to do this is through clicking point>on curve>click the curve>middle point>OK. which is fine for a few curves but not 2000+!

Ideally I'm thinking a macro that lets you pick the geometrical set and places a middle point on all of these curves. Failing that there may be an feature in CATIA already existing, points and planes repetition won't work as they are all individual curves.

Many thanks

Pete

RE: Points in middle of curve

just record your macro to create that middle point on the first curve, then edit the macro to create a loop with all curve in geometrical set.

you should have a minimum of VBA knowledge to accomplish this.

Eric N.
indocti discant et ament meminisse periti

RE: Points in middle of curve

(OP)
Hi,

I'm still learning my way through VB but i'm guessing it would be something like this:

Dim index As Integer = 0 change to string?
Do

recorded macro goes here

index += 1
Loop Until index > 10 change this to the number of curves or until curve name?

my question is how does it know to advanced to the next curve? shall I write another macro so it +1 to each curve value it is looking for?

Thanks

RE: Points in middle of curve

if you let the user select the geometrical set, you can use HybridShapes to get the list of shapes of that geometrical set.

you could takes each element in that list one after the other:

For each myCurve in myHybridBody.HybridShapes
create the point on myCurve here
Next


Check V5Automation.chm for more info about CATIA API...

Eric N.
indocti discant et ament meminisse periti

RE: Points in middle of curve

There is a specific command for what you want to do:

Dim Coordinates (8)
NewMeasurable.GetPointsOnCurve Coordinates

oCoordinates(0) is the X coordinate of the startpoint of the curve
oCoordinates(1) is the Y coordinate of the startpoint of the curve
oCoordinates(2) is the Z coordinate of the startpoint of the curve
oCoordinates(3) is the X coordinate of the midpoint of the curve
oCoordinates(4) is the Y coordinate of the midpoint of the curve
oCoordinates(5) is the Z coordinate of the midpoint of the curve
oCoordinates(6) is the X coordinate of the endpoint of the curve
oCoordinates(7) is the Y coordinate of the endpoint of the curve
oCoordinates(8) is the Z coordinate of the endpoint of the curve

If you use that, you will have to make a selection first

RE: Points in middle of curve

(OP)
Hi atomic nico,

is this a catia command or a VBA command?

Thanks

Pete

RE: Points in middle of curve

I think this is a VB/CATScript command

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