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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Create new CSYS same as sub level assembly csys, without any external reference

VA_3544793
10-Marble

Create new CSYS same as sub level assembly csys, without any external reference

 

Dear friends,

 

How to create new csys at "Top_assy.asm" , which same location and orientation of "A" csys, but it should be reference with "Main" csys, not "A" csys.

 

PS:  "A" csys & "Main" csys, reference handle already with me

 

Thanks.

 

csys.PNG

6 REPLIES 6
Ben_C
6-Contributor
(To:VA_3544793)

It sounds like case 2 from the code sample is what you require.

// The custom function ProDemoGeneralCsysCreate() supports below mentioned use cases:
// 1) Create CSYS at any level component referencing CSYS from any level or TOP Level
// 2) Create a CSYS in TOP level assembly referencing a CSYS from any level

 

https://www.ptc.com/en/support/article/CS138329 

I already tried. But the problem is external reference. I need it without external reference.

FV
17-Peridot
17-Peridot
(To:VA_3544793)

try to create an offset coordinate system at the desired location with the desired reference(s) using UI. Export element tree to XML file. Examine XML file - there going to be elements handling transformation (offset) values and elements handling references. In pro/toolkit app - calculate transformation matrix of the component coordinate system, get transformation matrix of this component to the assembly, multiply matrices. Calculate transformation matrix of the assembly coordinate system, multiply it with the previous result matrix - this will be the matrix which you would use to feed into XML file (in lame terms - the offset and rotational values of the component coordinate system in the coordinates of the assembly coordinate system which is going to be a parent of the new coordinate system), Use XML file to create an element tree, create feature.  Just a reminder, matrix multiplication is not commutative. 

HIH

VA_3544793
10-Marble
(To:FV)

Creating new csys with UI is very straight forward way. But through toolkit application only i need to perform. It's bit hard to understand. Can you please give the idea on the sequence of API'S above mentioned, that really helps me. Thanks

FV
17-Peridot
17-Peridot
(To:VA_3544793)

To create an XML file for elemtree use:

ProElemWrite(...)

To create a feature from an XML file use:

ProElemtreeFromXMLCreate(...)

To get a component transformation matrix use:

ProAsmcomppathTrfGet(...)

To get a csys transfrormation matrix use:

ProCsysDataGet(...)

Followed by composing a matrix from ProGeomitemdata data - an example is in the function ProUtilInvertCsysMatrix(...) ( pt_examples/pt_utils/UtilMatrix.c file)

 

To multiply and invert transformation matrices, use:

ProUtilMatrixProduct(...)
ProUtilMatrixInvert(...)

from UtilMatrix.c 

 

reading/writing data from/to XML file is up to application developer.

HIH

 

Hello @VA_3544793

 

It looks like you have some responses on your topic. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Community Moderation Team.

Top Tags