Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
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.
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
I already tried. But the problem is external reference. I need it without external reference.
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
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
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.