Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using 'getcoordinates' 5

Status
Not open for further replies.

dbwalters

Aerospace
May 19, 2006
6
Can anyone help me figure out how to use the technique 'getcoordinates' of a point from a different axis system???

Thanks in advance.

 
Replies continue below

Recommended for you

Thanks for the information, but I was wondering if you can provide some clarification?? Which 'help docs' are you referring to? Is there a link to this information that you can provide?
 
the docs are found in the help menu. all you have to do is point to the html file the first time. I believe it's a saparate installation. roughly around 1.5GB. usually stored on the network in a company environment.
 
Thanks for the help. Now, within the help documentation I assume I need to be looking in the 'Automation Documenatation'. But, I can't seem to find information about PInt - CAA IDL within this. Any other ideas that I can try?
 
Hi,

Go to c:\Program Files\Dassault Systemes\B14\intel_a\code\bin\V5Automation.chm and do a search of what you want

Regards
Fernando
 
Thanks to everyone for their valuable input, but, unfortunately I am not any closer to a solution. My problem is that I have some code in a macro that finds the coordinate information of some points but the X,Y,Z values are based from the default axis system:

Set originPts = hybridShapes1.Item(1)
originPts.GetCoordinates originCoord

What I would like to find out how to do is the same X,Y,Z values for these points except relative to a different axis system.
 
It seems to me that your problem is not with the GetCoordinates object, but rather the originCoord variable.

Don't you just need to swap it out for the coordinate system that you're after? (set the new coordinate system = to newCoord, and replace the originCoord variable)


---
CAD design engineering services - Catia V4, Catia V5, and CAD Translation. Catia V5 resources - CATBlog.
 
Unfortunately, I have the same problem with however I have my varible named. I originaly had my code like this:

Dim pts
Dim Coord(3)
Set hybridShapes1 = hybridBody1.HybridShapes
nump = hybridShapes1.Count

For i = 1 to nump
Set pts = hybridShapes1.Item(1)
pts.GetCoordinates Coord

'display result

next i

Extracting the coordinate values of the points I have in the hybrid body that this is searching gets the coordinates based on the default axis system.

I'm trying to write my code to act like the Measure tool does when the 'Other Axis' box is checked.
 
You'll find that it isn't possible to get the coordinates relative to another axis system using the VB API.

You need to get the point coordinates relative to the part axis system and then get the axis system origin and orientation vectors relative to the part axis system (assuming they are both in the same part).

Once you have this you need to perform the appropriate matrix transformations to calculate the point position relative to the axis system.

If the points and the axis system are in different parts of the product it becomes much more complex.

I think that you also have an error in your code:
Dim Coord(3)
should be:
Dim Coord(2)

If you've just created the point in your script, make sure that the part has been updated before you call GetCoordinates.

 
Thanks for everyone's help. Looks like I'll go to plan "B" and do some calculating.
 
Have a look at catiav5forum.com in the download area.

I've post a VBA code to get XYZ to text file.

Eric N.
indocti discant et ament meminisse periti
 
AHay's idea seems to be a good one.

If I understand this correctly, one could create the relevant coordinate system, and write a macro that would do the following:

1) axis to axis translation of the numbered points, one at a time AS A COPY. (all steps are based on the i=1 to number approach, including step 1)

2) measure point in originCoord. (to which it was just translated - relative measures are identical)

3) return value to Excel

4) delete copied point

5) loop to next point, until end



---
CAD design engineering services - Catia V4, Catia V5, and CAD Translation. Catia V5 resources - CATBlog.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor