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

Setting UDF Orientation using VBAPI

Anuja
Regular Member

Setting UDF Orientation using VBAPI

Hello,

 

In a project, I want to insert a UDF (consisting of a coordinate system and a revolve feature) to a base model via VB API. The revolve is drawn by referencing the coordinate system created for the UDF, hence for the UDF, only a coordinate system needs to be chosen as reference. Via the API , I am able to select the reference coordinate system for the UDF and the variant dimensions.

 

I also want to flip the UDF about a plane if certain conditions are met. This can be done when creating the UDF interactively from the "Adjustments" tab. There is a property called "Orientations" in IpfcUDFCustomCreateInstructions that can be used, I guess. However, I am not able to get it to work. Below is the snippet of the code I am using to achieve this:

 

Dim model As Ipfcsolid

Dim group As IpfcFeatureGroup
Dim udfInstructions As IpfcUDFCustomCreateInstructions

Dim orientVals As IpfcUDFOrientations
orientVals = New CpfcUDFOrientations
orientVals.Set(0, EpfcUDFOrientation.EpfcUDFORIENT_FLIP)
orientVals.Set(1, EpfcUDFOrientation.EpfcUDFORIENT_FLIP)
udfInstructions.Orientations = orientVals

group = model.CreateUDFGroup(udfInstructions)

 

Has anyone worked on flipping orientations and can help me figure out where I am going wrong?

 

Thank you!

Announcements