Skip to main content
4-Participant
Jun 27, 2023 6:43 AM UTC
Question

Using otk java to define element and how to use it,

1.use otk java to define element,and how to do use it,please give some demo

2.for exemple 

Elements elements = Elements.create();
//PRO_E_FEATURE_TREE
Element elem_0_0 = wfcElementTree.Element_Create(wfcElemIds.PRO_E_FEATURE_TREE, null, 0);
elements.append(elem_0_0);
//PRO_E_FEATURE_FORM
Element elem_1_2 = wfcElementTree.Element_Create(wfcElemIds.PRO_E_FEATURE_FORM, pfcArgument.CreateIntArgValue(1), 1);
elements.append(elem_1_2);
//PRO_E_EXT_SURF_CUT_SOLID_TYPE
Element elem_1_4 = wfcElementTree.Element_Create(wfcElemIds.PRO_E_EXT_SURF_CUT_SOLID_TYPE, pfcArgument.CreateIntArgValue(917), 1);
elements.append(elem_1_4);


//PRO_E_STD_EXT_DEPTH
Element elem_1_6 = wfcElementTree.Element_Create(wfcElemIds.PRO_E_STD_EXT_DEPTH, null, 1);
elements.append(elem_1_6);
//PRO_E_EXT_DEPTH_FROM
Element elem_2_0 = wfcElementTree.Element_Create(wfcElemIds.PRO_E_EXT_DEPTH_FROM, null, 2);
elements.append(elem_2_0);
//PRO_E_EXT_DEPTH_FROM_TYPE
Element elem_3_0 = wfcElementTree.Element_Create(wfcElemIds.PRO_E_EXT_DEPTH_FROM_TYPE, pfcArgument.CreateIntArgValue(128), 3);
elements.append(elem_3_0);
//PRO_E_EXT_DEPTH_FROM_VALUE
Element elem_3_1 = wfcElementTree.Element_Create(wfcElemIds.PRO_E_EXT_DEPTH_FROM_VALUE, pfcArgument.CreateDoubleArgValue(1), 3);
elements.append(elem_3_1);
//PRO_E_EXT_DEPTH_TO
Element elem_2_1 = wfcElementTree.Element_Create(wfcElemIds.PRO_E_EXT_DEPTH_TO, null, 2);
elements.append(elem_2_1);
// //PRO_E_EXT_DEPTH_TO_TYPE
Element elem_3_2 = wfcElementTree.Element_Create(wfcElemIds.PRO_E_EXT_DEPTH_TO_TYPE, pfcArgument.CreateIntArgValue(268435456), 3);
elements.append(elem_3_2);
//PRO_E_STD_SECTION
Element elem_1_7 = wfcElementTree.Element_Create(wfcElemIds.PRO_E_STD_SECTION, null, 1);
elements.append(elem_1_7);
//PRO_E_STD_SEC_SETUP_PLANE
Element elem_2_2 = wfcElementTree.Element_Create(wfcElemIds.PRO_E_STD_SEC_SETUP_PLANE, null, 2);
elements.append(elem_2_2);

//PRO_E_STD_SEC_PLANE
Element elem_3_3 = wfcElementTree.Element_Create(wfcElemIds.PRO_E_STD_SEC_PLANE, pfcArgument.CreateSelectionArgValue(dirSels1), 3);
elements.append(elem_3_3);

Point2D A = wfcSession.CreatePoint2D(90.00,90.00);
Point2D B = wfcSession.CreatePoint2D(90.00,-90.00);
Point2D C = wfcSession.CreatePoint2D(-90.00,-90.00);
Point2D D = wfcSession.CreatePoint2D(-90.00,90.00);
Point2D E = wfcSession.CreatePoint2D(90.00,90.00);
point2Ds.set(0, A); point2Ds.set(1, B); point2Ds.set(2, C); point2Ds.set(3, D); point2Ds.set(4, E);
SectionEntityPolyline rectangle = wfcSection.SectionEntityPolyline_Create(point2Ds);
SectionEntity line = (SectionEntity)rectangle;
sketch.AddEntity(line); 

 3. can't  drawing 3D  rectangle

4.is anyone can solve it  ,and  supply  a demo