Class ModelHelper
Assembly: CADAPI.DotnetHelper.dll
Syntax
public static class ModelHelper
Methods
AddExtrude(ComWrapper<ICadApiModel>, ComWrapper<ICadApiSketchFace>, double)
Append an extrude feature on the given sketch face with signed
depth. Body geometry materialises on the next Save.
Declaration
public static ComWrapper<ICadApiExtrudeFeature> AddExtrude(this ComWrapper<ICadApiModel> modelCom, ComWrapper<ICadApiSketchFace> faceCom, double depth)
Parameters
Returns
AddSketch(ComWrapper<ICadApiModel>, int, double)
Add a 2D sketch on one of the orthogonal coordinate planes.
normalAxis: 1 = X axis (YZ plane), 2 = Y axis
(XZ plane), 3 = Z axis (XY plane). offset
shifts the plane along the chosen axis. Draw with
AddLine / AddRectangle on the returned sketch,
then call Save(ComWrapper<ICadApiModel>) on this model to publish it as a
child tree node of the host CAD group.
Declaration
public static ComWrapper<ICadApiSketch> AddSketch(this ComWrapper<ICadApiModel> modelCom, int normalAxis, double offset)
Parameters
Returns
Bodies(ComWrapper<ICadApiModel>)
Declaration
public static IEnumerable<ComWrapper<ICadApiBody>> Bodies(this ComWrapper<ICadApiModel> modelCom)
Parameters
Returns
Body(ComWrapper<ICadApiModel>, int)
Return the body at the given zero-based index.
Declaration
public static ComWrapper<ICadApiBody> Body(this ComWrapper<ICadApiModel> modelCom, int index)
Parameters
Returns
BodyCount(ComWrapper<ICadApiModel>)
Number of bodies (parts) in this CAD model. A body is produced
by an import / extrude / revolve / sweep / merge feature.
Declaration
public static int BodyCount(this ComWrapper<ICadApiModel> modelCom)
Parameters
Returns
Feature(ComWrapper<ICadApiModel>, int)
Return the feature at the given zero-based index.
Declaration
public static ComWrapper<ICadApiFeature> Feature(this ComWrapper<ICadApiModel> modelCom, int index)
Parameters
Returns
FeatureCount(ComWrapper<ICadApiModel>)
Number of features in this CAD model's construction tree.
Declaration
public static int FeatureCount(this ComWrapper<ICadApiModel> modelCom)
Parameters
Returns
Features(ComWrapper<ICadApiModel>)
Enumerate all features in tree order.
Declaration
public static IEnumerable<ComWrapper<ICadApiFeature>> Features(this ComWrapper<ICadApiModel> modelCom)
Parameters
Returns
Save(ComWrapper<ICadApiModel>)
Publish in-memory CAD changes (new sketches, bodies) as child
tree nodes of the host CAD group, making them visible to other
CAMAPI consumers. Equivalent to "save sketch + exit CAD" in the
GUI.
Declaration
public static void Save(this ComWrapper<ICadApiModel> modelCom)
Parameters
Sketch(ComWrapper<ICadApiModel>, int)
Return the sketch at the given zero-based index.
Declaration
public static ComWrapper<ICadApiSketch> Sketch(this ComWrapper<ICadApiModel> modelCom, int index)
Parameters
Returns
SketchCount(ComWrapper<ICadApiModel>)
Number of sketches in this CAD model.
Declaration
public static int SketchCount(this ComWrapper<ICadApiModel> modelCom)
Parameters
Returns
Sketches(ComWrapper<ICadApiModel>)
Declaration
public static IEnumerable<ComWrapper<ICadApiSketch>> Sketches(this ComWrapper<ICadApiModel> modelCom)
Parameters
Returns