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