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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Getting complete Feature information

abursuk
12-Amethyst

Getting complete Feature information

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:

feature.PNG

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


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.
ACCEPTED SOLUTION

Accepted Solutions
FV
17-Peridot
17-Peridot
(To:abursuk)

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.

View solution in original post

10 REPLIES 10
abursuk
12-Amethyst
(To:abursuk)

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

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

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.

abursuk
12-Amethyst
(To:FV)

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

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

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.

abursuk
12-Amethyst
(To:FV)

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

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

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.

abursuk
12-Amethyst
(To:FV)

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

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

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.

abursuk
12-Amethyst
(To:FV)

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

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

ProFeatureInit or ProModelitemInit or ProModelitemByNameInit

Announcements


Top Tags