×
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

Finding the point of contact between parts

Finding the point of contact between parts

Finding the point of contact between parts

(OP)
Hello,

I am trying to find the point of contact between parts using VBA. I am using the interference module of CATIA and I can find the closest points in the case of a clash or clearance but it doesn't give the point of contact in that case. GetFirstPointCoordinates and GetSecondPointCoordinates return nothing in the case of a contact and it can't be found in the XML file exports either.
However using the Measure tool between two objects, even in the case of planar contact, gives a point of contact. So I have been trying to use the SPAWorkbench with GetMinimumDistancePoints to find the point that way. The problem is that I need to reference the products or parts themselves and not specific surfaces or vertices, just as it is possible to do using the Measure tool in CATIA. Does anyone know how to do this or has anyone successfully attacked this problem some other way??

Thanks in advance for your help.

RE: Finding the point of contact between parts

(OP)
It would appear that it is only possible to make a reference to something in a part, with the reference being in the context of the part. Is that so?
If so, does anyone know how to get around this??

RE: Finding the point of contact between parts

(OP)
Well I finally worked it out using the Distance objects:

CODE --> VBA

Dim cGroups
Set cGroups = CATIA.ActiveDocument.Product.GetTechnologicalObject("Groups")
Dim oGroup1
Set oGroup1 = cGroups.Add
Set truc = oconflict.FirstProduct
oGroup1.AddExplicit truc
Set truc = oconflict.SecondProduct
oGroup1.AddExplicit truc
           
Dim cDistances
Set cDistances = CATIA.ActiveDocument.Product.GetTechnologicalObject("Distances")
Dim odistance
Set odistance = cDistances.Add
odistance.FirstGroup = oGroup1
odistance.Compute
Call odistance.GetFirstPointCoordinates(pts1)
Call odistance.GetSecondPointCoordinates(pts2) 

RE: Finding the point of contact between parts

(OP)
Hello Again,
So now I am presented with another similar problem. Distance objects only work to find the distance between parts or products. To find the distance between for example a line and a plane, has to be done using the SPAworkbench. That, however, seems to work only inside of a part. If you try to do the same thing between two different parts the distance is calculated using the subtraction of the coordinates of each element with respect to their respective origins and not the global origin.
Does Anyone know how to get around that???
Thanks for you help.

RE: Finding the point of contact between parts

(OP)
Thanks for your response, Doug. The problem is, unfortunately, the extraction of the points.

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