cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

jlink question - measure from a coordinate system to a given coordinate system?

lylebeidler
1-Newbie

jlink question - measure from a coordinate system to a given coordinate system?

JLink application, WF3

I'm trying to assemble a light to a coordinate system origin. I know the
CSO has a given name, and I've traversed the assembly to find all the CSO's
that match that name. Now, however, I need to determine where the geometry
resides relative to the CSO of the top-level assembly. I tried using
GetTransform, but this gives the Transform matrix from the CSO to the CSO of
the part.



If that's not making sense, here's a description of my program:



Traverse the assembly, finding every instance of 1234.prt

For each instance of 1234.prt, get its location relative to the assembly CSO
& store it in a list, then delete it from the assembly.

For each record in the list, assemble 5678.prt in the same location in the
assembly (comment: if I didn't desire 5678.prt to be fully constrained, I
could stop here, but this leaves it packaged)

Traverse the assembly, finding all components with a CSO named "CS_LIGHT"

For each CS_LIGHT, get its location relative to the assembly CSO <==== this
is the step I'm having trouble with

If CS_LIGHT is in the correct location, constrain 5678.prt to this CSO.



Thanks in advance.

--



Lyle Beidler
MGS Inc
178 Muddy Creek Church Rd
Denver PA 17517
717-336-7528
Fax 717-336-0514
<">mailto:-> -
<">http://www.mgsincorporated.com>
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
2 REPLIES 2
bfrandsen
6-Contributor
(To:lylebeidler)

Lyle,
The TransformVector() method in the transform3D interface can be used to go from CS0 to CS_LIGHT coordinates, but it is a bit tricky I agree. The Invert() method can be useful too for this task.

/Bjarne
FV
17-Peridot
17-Peridot
(To:lylebeidler)

Hi all,


Lyle,


The proceedure should be as follows:


-aquire the transfrom from the the assembly csys feature in question 'CS0 ' toassembly 'default' coordinates, (in Pro/Toolkit you would use ProMatrixInit and feed it e1, e2,e3 and origin of ProGeomitemdata of coordinate system ProGeomitem), you have CS0-to-assembly transformation,


- invert transformation matrix, now you have assembly-to-CSO transformation,


-aquire the transformation of the component in question to the assembly 'default' coordinates, you have component-to-assembly transformation,


-aquire the XYZ location of a component CS_LIGHT feature expressed in component default coordinate system.


-transfer XYZ point to an assembly 'default' coordinate system (Pro/Toolkit function ProPointTrfEval) using component-to-assembly matrix, you have A-XYZ now,


-transfer A-XYZ to CSO coordinates by using assembly-to-CSO matrix, now you going to have C-XYZ, those three numbers represent the distance from CSO to CS_LIGHT measured along the axis of CSO coordinate system.


HIH.


Feliks.

In Reply to Lyle Beidler:


JLink application, WF3

I'm trying to assemble a light to a coordinate system origin. I know the
CSO has a given name, and I've traversed the assembly to find all the CSO's
that match that name. Now, however, I need to determine where the geometry
resides relative to the CSO of the top-level assembly. I tried using
GetTransform, but this gives the Transform matrix from the CSO to the CSO of
the part.



If that's not making sense, here's a description of my program:



Traverse the assembly, finding every instance of 1234.prt

For each instance of 1234.prt, get its location relative to the assembly CSO
& store it in a list, then delete it from the assembly.

For each record in the list, assemble 5678.prt in the same location in the
assembly (comment: if I didn't desire 5678.prt to be fully constrained, I
could stop here, but this leaves it packaged)

Traverse the assembly, finding all components with a CSO named "CS_LIGHT"

For each CS_LIGHT, get its location relative to the assembly CSO <==== this
is the step I'm having trouble with

If CS_LIGHT is in the correct location, constrain 5678.prt to this CSO.



Thanks in advance.

--



Lyle Beidler
MGS Inc
178 Muddy Creek Church Rd
Denver PA 17517
717-336-7528
Fax 717-336-0514
< -
< http://www.mgsincorporated.com



Top Tags