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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

ProUdfdataOrientation in ProToolkit

ptc-2531487
1-Newbie

ProUdfdataOrientation in ProToolkit

I am using aUDF to place an extrude feature in a sheet metal part. In the UDF a datum plane is being created which uses an edge as a reference. Depending on the face which is selected I sometimes need to FLIP the orientation. The UI presents a nice visual for this but I cannot find any toolkit call to get the orientation direction in order to determine if FLIP will be required.

What method should I use to determine if I need to set the orientation to PROUDFORIENT_FLIP ?

Is it possible to create the UDF where this would no be required ? I always want the FLIP arrow pointing toward the face where the extrude will be created.

thanks for you help

Joe


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.
2 REPLIES 2
FV
17-Peridot
17-Peridot
(To:ptc-2531487)

Hi all,

Joe,

I would make sure that the UDF itself was created in the first quadrant of the default coordinate system (X+ Y+ Z+) , so you wouldknow the direction of the original protrusion - itshouldbe to the 'YELLOW' side of datum planes (or whaterver WF color scheme does now).

When you were placing a UDF programmatically you are probably had 'ProSelect' for edges,from which you couldgetaProFeature (protrusion)which owns edge ProGeomitem's. From the element tree of the protrusion you could get the sketching plane, from the sketching plane you could get e3 normal vector and a plane origin.From anyone ofselected edges you should geta XYZ point onan edge.Calculate the vector from the plane origin to theedge XYZ point. Comparedirection with the e3 direction (dot product). Ifvectorsare pointing in the same direction no FLIP required and vise versa.

HIH.

Feliks.

In Reply to Joe Wheatley:

I am using aUDF to place an extrude feature in a sheet metal part. In the UDF a datum plane is being created which uses an edge as a reference. Depending on the face which is selected I sometimes need to FLIP the orientation. The UI presents a nice visual for this but I cannot find any toolkit call to get the orientation direction in order to determine if FLIP will be required.

What method should I use to determine if I need to set the orientation to PROUDFORIENT_FLIP ?

Is it possible to create the UDF where this would no be required ? I always want the FLIP arrow pointing toward the face where the extrude will be created.

thanks for you help

Joe

FV
17-Peridot
17-Peridot
(To:ptc-2531487)

one more thing, after giving it some thought...

If UDF plane is going to be created on two edges you need to get the parent surface of the edges and get a normal and origin of that surface...

Feliks.

Top Tags