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
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
you should have a minimum of VBA knowledge to accomplish this.
indocti discant et ament meminisse periti
RE: Points in middle of curve
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
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...
indocti discant et ament meminisse periti
RE: Points in middle of curve
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
is this a catia command or a VBA command?
Thanks
Pete
RE: Points in middle of curve
RE: Points in middle of curve
http://www.gtwiki.org/mwiki/index.php?title=PowerCopy_Instantiator_by_Geometrical_Sets
Good luck,
Doug