Home Page > KernelCAD Components > Advanced functionality > Programming commands
Programming topological commands
Programming topological commands
This topic explains how to perform programmatically commands available in
3D Debugger. See also StripTopol Sample
Break Command
The Break Command divides a surface element in two.
Break() method of IStripTopol interface performs this
operation programmatically. Normally path to IStripTopol is:
KernelCAD->IModel->IStrip->IStripTopol.
Close Loop Command
The Close Loop command adds a new straight segment which joins
ends of the current strip to make it closed. Close Loop command does not
have any effect for strips which consist of a single segment. This command is
executed only if the resulting loop will have a valid orientation (see Segment
Strips) . CloseLoop method of IStripTopol interface performs this
operation programmatically.
Delete Command
The Delete Command deletes the currently selected segment
from the strip. Note that strip in a 2D editor is assumed to be connected at all times, meaning that any two points
are linked with a segment strip. Because of that, deleting a middle segment
from a non-closed strip will delete the rest of the strip. This will not happen if you are deleting an end segment from a
non-closed strip.
Delete method of IStripTopol interface performs this
operation programmatically.
New knot Command
This command will add a new knot at the current cross-section position if the
cross-section position does not coincide with one of existing knots. In the
latter case the command does not have any effect. This command is a shortcut for
Base > New Knot menu option.
Programmatic: Use path IModel->
ISection->IAxiBase->IArray to
retrieve IArray of axial knots. A new knot can be added than by using InsertAt
method.
Add Command
The Add command will create a new joint in the current strip (strip of
patches in case of 3DO or strip of revolved 2D lines in case of SOR) by
extending one if its ends.
Add method of IStripTopol interface performs this
operation programmatically.
Join Command
The Join command attaches the Current Object
to another object.
Joined sections will move together as a solid object when moved with mouse or by
using the Current Object Page. The Join command allows to create complex objects from simpler ones. To
join object A to object B obtain ISection implemented by A. Obtain
IArray from B. Use Add or
InsertAt methods of IArray to add ISection
to the children array of B.
Detach Command
The Detach Command detaches an object from the object it is joined
to (the parent object) and makes it a top level object in the model. Obtain ISection
from the object. It is important to do it first. Delete the object
from its parent (See Delete Object Command below). Obtain
IArray from IModel. Use Add or
InsertAt methods of
IArray to add ISection
to the array of objects in the model.
Delete Object Command
Obtain
IArray from IModel if the
object is a top level one or from ISection of its
parent. Use RemoveAt method
of IArray to remove the object from the array. To get position of the object in
the array obtain ISection from the object to be deleted and use Find
method
of IArray to find the index.
|