K
K
Konstantin2021-03-17 04:08:08
API
Konstantin, 2021-03-17 04:08:08

How to change reference plane normal direction in SolidWorks using SolidWorks 2016 API?

A Reference Plane is created using the appropriate InsertRefPlane method , which takes only 6 parameters (2 parameters for each reference), while there is also the "Flip normal" option when building manually.
60514d77c3e40889984999.png
You can also change the normal manually on an already constructed plane. When you try to change the direction of the normal on an already constructed plane, nothing happens.
C# code:

swRefPlane = (RefPlane)swFeatureManager.InsertRefPlane(8, 0.05, 0, 0, 0, 0); // создание плоскости со смещением
swFeat = swRefPlane as Feature;
var data = swFeat.GetDefinition() as RefPlaneFeatureData;
data.AccessSelections(swModel, null);
data.ReverseDirection = true;
swFeat.ModifyDefinition(data, swModel, null);

API links

GetDefinition()
ModifyDefinition(data, swModel, null)
Modify Plane by Editing Its Definition Example (VBA)
RefPlaneFeatureData

How to change the direction of the normal of the plane (Reference Plane) using only the API ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question