21 Replies Latest reply on Oct 30, 2017 3:02 PM by Deepak Gupta

    how can I flip normal of plane API

    Cloud Strife Pom Cloud Strife Pom

      I found out that SolidWork2014 has a feature to flip normal of the reference plane



      flip normal.png


      i check the parameter in C# and found out that this option related to RefPlaneFeatureData.ReverseDirection  (its changed to true and false correspond to the option)
      however when i try to change it manually

      like this  in C#


                  IModelDoc swMainDoc = SwAddin.iSwApp.ActiveDoc;

                  bool checking = (swMainDoc as ModelDoc2).Extension.SelectByID2("Top", "PLANE", 0, 0, 0, false, 0, null, 0);

                  if (checking)


                      IFeature TopPlane = swMainDoc.ISelectionManager.GetSelectedObject(1);

                      for (int i = 0; i < inputPositiveValue.Count; i++)


                          IRefPlane tempRef = (swMainDoc as ModelDoc2).FeatureManager.InsertRefPlane(8, inputPositiveValue[i] / 1000, 0, 0, 0, 0);


                          IFeature refplane = (IFeature)tempRef;

                          RefPlaneFeatureData refplaneDAta = (RefPlaneFeatureData)refplane.GetDefinition();

                          bool checkingAccessSElection = refplaneDAta.IAccessSelections((ModelDoc2)swMainDoc, null);



                          refplaneDAta.ReverseDirection = !refplaneDAta.ReverseDirection; <----- this line its value won't change



                          bool checkingmodify = refplane.IModifyDefinition2(refplaneDAta, (ModelDoc2)swMainDoc, null);









      acessselection return true

      but i cannot change the reversedirection


      any  ideas ???