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
Hey guys,
I'm trying to get a complete information about a feature(say extrude).
I've already got section(sketch) information. It wasn't hard at all.
Now I'm about to get properties of Extrude feature itself.
I mean these:
Is it extrusion from sketch to some distance, or extrusion between planes, or sketch is a center plane for extrusion, and so on and so forth.
I did read user Guide for Object Toolkit and it seems, necessary information is stored in a Future Element Tree(14. Feature Element Tree, 18. Features).
Now I got features elements and their values:
element id: PRO_E_FEATURE_TYPE
element value: 917
element id: PRO_E_EXT_SURF_CUT_SOLID_TYPE
element value: 917
The question is, am I correct? If I do need information about feature, should I use Feature Element Tree for that?
If yes, where can I find description for this element IDs? Cause it's not clear for me what is PRO_E_FEATURE_TYPE and what means 917 for this element. I parsed the User guide, headers and couldn't find any description
Thank you in advance,
Artem
Solved! Go to Solution.
Hi all,
Artem,
You'll need to get a feature elemtree with ProFeatureElemtreeExtract(...) and then get a reference to sketch(section) plane by accessing PRO_E_STD_SECTION element and then PRO_E_STD_SEC_PLANE element. It will give you ProReference to a parent surface.
You should take a look at TestExtrude.c in pt_examples it has everything you'll need...
HIH.
Feliks.
Hey,
Using empirical method I figured out which elements are crucial to determine general feature parameters.
Only one thing is still not clear to me: How can I determine on whether plane my feature was initiated.
E.g. I have sketch(section) with rectangle there. Using extrude feature I will get a cube.
Nice, Now I want to create a lesser cube on a face of existing one. Done!
How can I get now the information about whether face was used to create sketch(section) for the lesser cube?
I can imagine only one opportunity to get geometrical info: take it from sketch, because all the curves on sketch will be placed in a single plane(sketch plane).
The final goal for me is to get point in sketch, but not the boundary ones(which I can get from the sketch).
Thanks,
Artem
Hi all,
Artem,
You'll need to get a feature elemtree with ProFeatureElemtreeExtract(...) and then get a reference to sketch(section) plane by accessing PRO_E_STD_SECTION element and then PRO_E_STD_SEC_PLANE element. It will give you ProReference to a parent surface.
You should take a look at TestExtrude.c in pt_examples it has everything you'll need...
HIH.
Feliks.
Hi Feliks,
Thanks for the answer, it seems what I was looking for!
PS:
Maybe you happen to know which elements represent boundary surfaces for extrude? In case I want to perform extrude till surface\face ?
Thanks,
Artem
don't remember of the top of my head. You should make a utility function to call ProElemtreeWrite(...), this will help you to visualize feature tree layout and element names.
Hi Feliks,
Can you pls help me one more time
In case when my Extrude feature was built on top of a Sketch, I do not have PRO_E_STD_SEC_PLANE element.
All I have with type = pfcARG_V_SELECTION in a tree: PRO_E_SEC_USE_SKETCH
It is pointing to a feature with type Curve. And I can't figure out, how can I get surface from it.
According to the User Guide, there should be also element PRO_E_SKETCHER
which is pointing to a Section. But in my example(Sketch - > extrude) there is no such element
Thank you in advance,
Artem
Hi all,
Artem,
Please use Pro/Toolkit function ProElemtreeWrite(...) to output your feature elemtree to XML file and please post the resulting data. It is quite difficult to guess what is not working without seeing output.
Feliks.
Hi Feliks,
You can find xml file attached.
My question is: how can I determine whether this sketch for this feature was created on a Plane(FRON, TOP, RIGHT or created by user plane) or on the Face of created earlier solid?
Thanks,
Artem
Artem,
This block tells you that an 'external' sketch is in use:
<PRO_E_STD_SEC_METHOD type="int">0</PRO_E_STD_SEC_METHOD>
<PRO_E_SEC_USE_SKETCH type="selection">
<PRO_XML_REFERENCE type="reference">
<PRO_XML_REFERENCE_OWNER type="owner">PRT0001.prt</PRO_XML_REFERENCE_OWNER>
<PRO_XML_REFERENCE_ID type="id">40</PRO_XML_REFERENCE_ID>
<PRO_XML_REFERENCE_TYPE type="protype">PRO_FEATURE</PRO_XML_REFERENCE_TYPE>
</PRO_XML_REFERENCE>
...
You'll need to get ProFeature of 'Sketch Feature' ( id is 40, it is a parent of your extrude feature). From sketch' ProFeature to get an element tree, from element tree to get a PRO_E_STD_SEC_PLANE which is a ProSelection (ProReference) of some ProGeomitem, from ProGeomitem you'll get containing ProFeature with ProGeomitemFeatureGet, from ProFeature to get ProFeattype which will be either datum plane or something else. If it is a datum plane then get a name with ProModelitemNameGet.
HIH.
Feliks.
hi Feliks, everyone
Just one small question: How can I get ProFeature of Sketch Feature by ID?
I know only two ways, but both are quite long:
1. ProSolidFeatVisit() and filter by ID
2. Get ProSelection from PRO_E_SEC_USE_SKETCH under current (Extrude) Feature and transform it into ProFeature using the same flow as you described for PRO_E_STD_SEC_PLANE: ProGeomitemFeatureGet()
Maybe there is some quick way to get ProFeature using it's ID?
Thanks,
Artem
ProFeatureInit or ProModelitemInit or ProModelitemByNameInit