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!

Points in middle of curve

Status
Not open for further replies.

pdjpeter

Aerospace
Jan 22, 2015
5
GB
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
 
Replies continue below

Recommended for you

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
 
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
 
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
 
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
 
Hi atomic nico,

is this a catia command or a VBA command?

Thanks

Pete
 
If you're in a hurry and don't need the programming experience, you could use the PowerCopy Instantiator Macro. After you get the hang of it, it is really handy for repetitive tasks like yours and does not have to be customized. It will work on anything that you can make a PowerCopy of.
[URL unfurl="true"]http://www.gtwiki.org/mwiki/index.php?title=PowerCopy_Instantiator_by_Geometrical_Sets[/url]

Good luck,
Doug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top