Show / Hide Table of Contents

Class Part

A Part is a container for bodies, and can hold zero or more bodies. A Part also contains an orientation.

Inheritance
object
ProjectObject
GraphicComponent
Part
Implements
IHasTransform
IHasFrames
ISupportCopy
IAttachableParent
IAttachableChild
IHasGeometry
Inherited Members
GraphicComponent._definition
GraphicComponent._childInstances
GraphicComponent._transformMat
GraphicComponent._pickingEnabled
GraphicComponent._frames
GraphicComponent._source
GraphicComponent._sourceFileTime
GraphicComponent._detectable
GraphicComponent._clipPlane
GraphicComponent.OnCreatingObject()
GraphicComponent.OnDelete()
GraphicComponent.OnUndoRedo()
GraphicComponent.GetMatrix()
GraphicComponent.SetMatrix(Matrix4)
GraphicComponent.OnDefinitionChanged()
GraphicComponent.SetMaterial(Material, bool)
GraphicComponent.Copy()
GraphicComponent.CopyInstance()
GraphicComponent.MoveDefinitionToLibrary()
GraphicComponent.Highlight(bool)
GraphicComponent.Highlight(bool, Color)
GraphicComponent.DisconnectFromLibrary()
GraphicComponent.DeleteGeometry(bool)
GraphicComponent.DeleteGeometry()
GraphicComponent.GetNormalToSurface(Vector3, out Vector3, out Vector3, out Face)
GraphicComponent.TryGetNormalToSurface(Vector3, out Vector3, out Vector3, out Face)
GraphicComponent.GetBoundingBox(bool, out Vector3, out Vector3)
GraphicComponent.GetBoundingBox(bool)
GraphicComponent.GetBoundingBox(bool, IntPtr, IntPtr)
GraphicComponent.ImportAsync(string)
GraphicComponent.ImportAsync(string, GraphicImportSettings, IProgressCallback)
GraphicComponent.CanImport(string)
GraphicComponent.ImportXml(string, string, string, string)
GraphicComponent.ImportXmlAsync(string, string, string, string)
GraphicComponent.ImportXml(string, string, Dictionary<string, string>)
GraphicComponent.ImportXmlAsync(string, string, Dictionary<string, string>)
GraphicComponent.ImportXml(string, string)
GraphicComponent.ImportXmlAsync(string, string)
GraphicComponent.ImportXml(string)
GraphicComponent.ImportXmlAsync(string)
GraphicComponent.ExportXml(string, string)
GraphicComponent.ExportXml(string)
GraphicComponent.GetGfxMatrix()
GraphicComponent.GetGfxChildren()
GraphicComponent.Parent
GraphicComponent.Library
GraphicComponent.Transform
GraphicComponent.IsTransient
GraphicComponent.Color
GraphicComponent.Opacity
GraphicComponent.PickingEnabled
GraphicComponent.Detectable
GraphicComponent.ClipPlane
GraphicComponent.Frames
GraphicComponent.Annotations
GraphicComponent.PhysicsMotionControl
GraphicComponent.GfxData
ProjectObject._curUndoDeltaState
ProjectObject.FindObjects(Predicate<ProjectObject>, Predicate<ProjectObject>)
ProjectObject.ToString()
ProjectObject.Backup(bool)
ProjectObject.NotifyChange()
ProjectObject.NotifyChange(ProjectObjectChangeType)
ProjectObject.BeforeSave(PimDocument)
ProjectObject.Name
ProjectObject.DisplayName
ProjectObject.ContainingProject
ProjectObject.Attributes
ProjectObject.UIVisible
ProjectObject.TypeDisplayName
ProjectObject.UniqueId
ProjectObject.InternalChildren
ProjectObject.InternalParent
ProjectObject.Children
ProjectObject.DisplayNameChanged
ProjectObject.ProjectObjectChanged
ProjectObject.InternalEvent
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
[Persistent("ComponentInstance")]
public class Part : GraphicComponent, IHasTransform, IHasFrames, ISupportCopy, IAttachableParent, IAttachableChild, IHasGeometry

Constructors

View Source

Part()

Creates a new empty Part

Declaration
public Part()
View Source

Part(bool)

Declaration
public Part(bool supportGeometry)
Parameters
Type Name Description
bool supportGeometry

Properties

View Source

Bodies

Gets the BodyCollection that belongs to this Part.

Declaration
public BodyCollection Bodies { get; }
Property Value
Type Description
BodyCollection
Examples

Add a body to the part.

Project.UndoContext.BeginUndoStep("PartProperties");
try
{
Station station = Station.ActiveStation;
            // Create a part.
            #region PartPropertiesStep1
            Part myPart1 = new Part();
            myPart1.Name = "MyPart_1";
            #endregion

            // Add the part to the graphics componenets collection of the station.
            #region PartPropertiesStep2
            station.GraphicComponents.Add(myPart1);
            #endregion

            // Create a box and add it to myPart.
            #region PartPropertiesStep3
            Matrix4 box_origin = new Matrix4(Vector3.XVector, 0.0);
            Vector3 box_size = new Vector3(0.1, 0.1, 0.1);
            Body box = Body.CreateSolidBox(box_origin, box_size);
            box.Name = "MyBox";
            myPart1.Bodies.Add(box);
            #endregion

            // Create a cylinder and add it to myPart.
            #region PartPropertiesStep4
            Matrix4 origin = new Matrix4(new Vector3(Axis.X), 0.0);
            double radius = 0.2;
            double height = 1.0;
            Body myCylinder = Body.CreateSolidCylinder(origin, radius, height);
            myCylinder.Name = "MyCylinder";
            myPart1.Bodies.Add(myCylinder);
            #endregion

            // Make all the geometries in myPart orange.
            // When using VSTA, change to these lines instead:
            // Byte R1 = 255; Byte G1 = 165; Byte B1 = 0;
            // VSTABridge.SetColor(myPart, R1, G1, B1);
            #region PartPropertiesStep5
            myPart1.Color = Color.Orange;
            #endregion

            #region PartPropertiesStep6
            myPart1.Visible = true;
            #endregion
            myPart1.PickingEnabled = true;

            // Move myPart and all the bodies in it 100 mm along the 
            // X-axis and 100 mm along the Y-axis.
            #region PartPropertiesStep7
            myPart1.Transform.X = myPart1.Transform.X + 0.1;
            myPart1.Transform.Y = myPart1.Transform.Y + 0.1;
            #endregion

            // Create a copy of myPart.
            #region PartPropertiesStep8
            Part myPart2 = (Part)myPart1.Copy();
            myPart2.Name = "MyPart_2";
            #endregion

            // Add myPart2 to the station.
            #region PartPropertiesStep9
            station.GraphicComponents.Add(myPart2);
            #endregion
            #region PartPropertiesStep10
            GraphicComponentLibrary myLib = myPart2.MoveDefinitionToLibrary();
            Logger.AddMessage(new LogMessage(
                $"The RootComponent of the Lib is: {myLib.RootComponent.Name}"));

            // Save a copy of the lib.
            // Get the path to the user project folder.
            string userProjPath =
                (string)Options.GetValue("RobotStudio", "Directories.UserDocuments");
            if (userProjPath != null)
            {
                myLib.SaveAs(userProjPath + "\\Libraries\\myLib.rslib");
            }
            else
            {
                // If there is no UserprojPath, save it in user documents.
                myLib.SaveAs(Path.Combine
                (System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments), "myLib.rslib"));
            }
            #endregion

            // Create a new instance of myPart.
            #region PartPropertiesStep11
            Part myPart3 = (Part)myPart1.CopyInstance();
            #endregion

            // Add myPart3 to the station.
            station.GraphicComponents.Add(myPart3);

            // Delete the geometry of myPart3.
            // This causes the geometry of myPart1 to be deleted to,
            // since they use the same definition.
            #region PartPropertiesStep12
            myPart3.DeleteGeometry();
            #endregion

            // Disconnect myPart2 from its library.
            #region PartPropertiesStep13
            myPart2.DisconnectFromLibrary();
            #endregion
            // Close the library
            myLib.Close();

            // Get the normal of myPart2
            #region PartPropertiesStep14
            BoundingBox bbox = myPart2.GetBoundingBox(true);
            Vector3 firstCorner = bbox.min;
            Vector3 secondCorner = bbox.max;
            Logger.AddMessage(new LogMessage(
                $"The first corner of the bounding box is ( {firstCorner.x}; {firstCorner.y}; {firstCorner.z} )"));
            Logger.AddMessage(new LogMessage(
                $"The second corner of the bounding box is ( {secondCorner.x}; {secondCorner.y}; {secondCorner.z} )"));
            Vector3 testPoint = new Vector3(0.0, 0.0, 0.0);
            Vector3 hitPoint;
            Vector3 hitPointNormal;
            Face hitFace;
            myPart2.TryGetNormalToSurface(testPoint, out hitPoint, out hitPointNormal, out hitFace);
            #endregion

            // Make the hitFace green.
            // When using VSTA, change to these lines instead:
            // Byte R = 0; Byte G = 255; Byte B = 0;
            // VSTABridge.SetColor(hitFace, R, G, B);
            hitFace.Color = Color.Green;
            Logger.AddMessage(new LogMessage(
                $"The hit point from GetNormalToSurface at test point (0,0,0) is: ( {hitPoint.x}; {hitPoint.y}; {hitPoint.z} )"));
            Logger.AddMessage(new LogMessage(
                $"The hit point normal from GetNormalToSurface at test point (0,0,0) is: ( {hitPointNormal.x}; {hitPointNormal.y}; {hitPointNormal.z} )"));
        }
        catch
        {
            Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
            throw;
        }
        finally
        {
            Project.UndoContext.EndUndoStep();
        }</code></pre>
View Source

HasGeometry

True if the part has CAD geometry, false otherwise.

Declaration
public bool HasGeometry { get; }
Property Value
Type Description
bool
View Source

Mesh

Returns the graphic representation of this Part.

Declaration
public Mesh Mesh { get; }
Property Value
Type Description
Mesh
View Source

Source

Gets or sets the file that was the source of this part.

Declaration
public string Source { get; set; }
Property Value
Type Description
string
Remarks

This property is not set by the Part.Load() method, it has to be set manually.

View Source

SourceDateTime

Gets or sets a time stamp of the last update from Part.Source (in UTC)

Declaration
public DateTime SourceDateTime { get; set; }
Property Value
Type Description
DateTime
View Source

Visible

Gets or sets whether the part is visible or not in the graphics.

Declaration
public override bool Visible { get; set; }
Property Value
Type Description
bool
Overrides
GraphicComponent.Visible
Examples

Set Visible.

Project.UndoContext.BeginUndoStep("PartProperties");
try
{
Station station = Station.ActiveStation;
            // Create a part.
            #region PartPropertiesStep1
            Part myPart1 = new Part();
            myPart1.Name = "MyPart_1";
            #endregion

            // Add the part to the graphics componenets collection of the station.
            #region PartPropertiesStep2
            station.GraphicComponents.Add(myPart1);
            #endregion

            // Create a box and add it to myPart.
            #region PartPropertiesStep3
            Matrix4 box_origin = new Matrix4(Vector3.XVector, 0.0);
            Vector3 box_size = new Vector3(0.1, 0.1, 0.1);
            Body box = Body.CreateSolidBox(box_origin, box_size);
            box.Name = "MyBox";
            myPart1.Bodies.Add(box);
            #endregion

            // Create a cylinder and add it to myPart.
            #region PartPropertiesStep4
            Matrix4 origin = new Matrix4(new Vector3(Axis.X), 0.0);
            double radius = 0.2;
            double height = 1.0;
            Body myCylinder = Body.CreateSolidCylinder(origin, radius, height);
            myCylinder.Name = "MyCylinder";
            myPart1.Bodies.Add(myCylinder);
            #endregion

            // Make all the geometries in myPart orange.
            // When using VSTA, change to these lines instead:
            // Byte R1 = 255; Byte G1 = 165; Byte B1 = 0;
            // VSTABridge.SetColor(myPart, R1, G1, B1);
            #region PartPropertiesStep5
            myPart1.Color = Color.Orange;
            #endregion

            #region PartPropertiesStep6
            myPart1.Visible = true;
            #endregion
            myPart1.PickingEnabled = true;

            // Move myPart and all the bodies in it 100 mm along the 
            // X-axis and 100 mm along the Y-axis.
            #region PartPropertiesStep7
            myPart1.Transform.X = myPart1.Transform.X + 0.1;
            myPart1.Transform.Y = myPart1.Transform.Y + 0.1;
            #endregion

            // Create a copy of myPart.
            #region PartPropertiesStep8
            Part myPart2 = (Part)myPart1.Copy();
            myPart2.Name = "MyPart_2";
            #endregion

            // Add myPart2 to the station.
            #region PartPropertiesStep9
            station.GraphicComponents.Add(myPart2);
            #endregion
            #region PartPropertiesStep10
            GraphicComponentLibrary myLib = myPart2.MoveDefinitionToLibrary();
            Logger.AddMessage(new LogMessage(
                $"The RootComponent of the Lib is: {myLib.RootComponent.Name}"));

            // Save a copy of the lib.
            // Get the path to the user project folder.
            string userProjPath =
                (string)Options.GetValue("RobotStudio", "Directories.UserDocuments");
            if (userProjPath != null)
            {
                myLib.SaveAs(userProjPath + "\\Libraries\\myLib.rslib");
            }
            else
            {
                // If there is no UserprojPath, save it in user documents.
                myLib.SaveAs(Path.Combine
                (System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments), "myLib.rslib"));
            }
            #endregion

            // Create a new instance of myPart.
            #region PartPropertiesStep11
            Part myPart3 = (Part)myPart1.CopyInstance();
            #endregion

            // Add myPart3 to the station.
            station.GraphicComponents.Add(myPart3);

            // Delete the geometry of myPart3.
            // This causes the geometry of myPart1 to be deleted to,
            // since they use the same definition.
            #region PartPropertiesStep12
            myPart3.DeleteGeometry();
            #endregion

            // Disconnect myPart2 from its library.
            #region PartPropertiesStep13
            myPart2.DisconnectFromLibrary();
            #endregion
            // Close the library
            myLib.Close();

            // Get the normal of myPart2
            #region PartPropertiesStep14
            BoundingBox bbox = myPart2.GetBoundingBox(true);
            Vector3 firstCorner = bbox.min;
            Vector3 secondCorner = bbox.max;
            Logger.AddMessage(new LogMessage(
                $"The first corner of the bounding box is ( {firstCorner.x}; {firstCorner.y}; {firstCorner.z} )"));
            Logger.AddMessage(new LogMessage(
                $"The second corner of the bounding box is ( {secondCorner.x}; {secondCorner.y}; {secondCorner.z} )"));
            Vector3 testPoint = new Vector3(0.0, 0.0, 0.0);
            Vector3 hitPoint;
            Vector3 hitPointNormal;
            Face hitFace;
            myPart2.TryGetNormalToSurface(testPoint, out hitPoint, out hitPointNormal, out hitFace);
            #endregion

            // Make the hitFace green.
            // When using VSTA, change to these lines instead:
            // Byte R = 0; Byte G = 255; Byte B = 0;
            // VSTABridge.SetColor(hitFace, R, G, B);
            hitFace.Color = Color.Green;
            Logger.AddMessage(new LogMessage(
                $"The hit point from GetNormalToSurface at test point (0,0,0) is: ( {hitPoint.x}; {hitPoint.y}; {hitPoint.z} )"));
            Logger.AddMessage(new LogMessage(
                $"The hit point normal from GetNormalToSurface at test point (0,0,0) is: ( {hitPointNormal.x}; {hitPointNormal.y}; {hitPointNormal.z} )"));
        }
        catch
        {
            Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
            throw;
        }
        finally
        {
            Project.UndoContext.EndUndoStep();
        }</code></pre>

Methods

View Source

AfterLoad(PimDocument)

Declaration
protected override void AfterLoad(PimDocument doc)
Parameters
Type Name Description
PimDocument doc
Overrides
GraphicComponent.AfterLoad(PimDocument)
View Source

Attach(IAttachableChild, bool, Matrix4)

Attach the supplied child to this Part.

Declaration
public bool Attach(IAttachableChild child, bool mount, Matrix4 offset)
Parameters
Type Name Description
IAttachableChild child

The child to be attached.

bool mount

Set to true if you want to mount the child to the parent. False to keep the current position.

Matrix4 offset

Only to be used when mount is set to true. This is the transform from the parent to the child.

Returns
Type Description
bool

True if the attachment is not null. Otherwise false.

View Source

CanAttachChild(IAttachableChild)

Test if the supplied child can be attached.

Declaration
public bool CanAttachChild(IAttachableChild child)
Parameters
Type Name Description
IAttachableChild child

The child to test for attachment.

Returns
Type Description
bool

True.

Remarks

This is always true for parts.

View Source

Delete()

Deletes this object permanently.

Declaration
public override void Delete()
Overrides
GraphicComponent.Delete()
Remarks

The object must first be removed from its parent. Any subsequent attempts to access the object or its children will fail. Use with caution. The operation is not undoable.

View Source

Detach(IAttachableChild)

Detach the supplied child from this Part. If the child was mounted to the parent when the attachment was created, the child will move back to its original position.

Declaration
public bool Detach(IAttachableChild child)
Parameters
Type Name Description
IAttachableChild child

The child to be detached.

Returns
Type Description
bool

True if the child could be detached. False if the child never was attached to the parent.

View Source

Facet(DetailLevels)

Re-creates the graphical representation of this Part.

Declaration
public void Facet(DetailLevels detailLevels)
Parameters
Type Name Description
DetailLevels detailLevels
View Source

Facet(DetailLevels, bool)

Re-creates the graphical representation of this Part.

Declaration
public void Facet(DetailLevels detailLevels, bool surfaceModel)
Parameters
Type Name Description
DetailLevels detailLevels
bool surfaceModel
View Source

Facet(DetailLevels, bool, ProgressNotification)

Re-creates the graphical representation of this Part.

Declaration
public void Facet(DetailLevels detailLevels, bool surfaceModel, ProgressNotification progress)
Parameters
Type Name Description
DetailLevels detailLevels
bool surfaceModel
ProgressNotification progress
View Source

FindClosestVertex(Vector3)

Returns the Vertex of the Loop that is closest to the provided point.

Declaration
public Vertex FindClosestVertex(Vector3 testPoint)
Parameters
Type Name Description
Vector3 testPoint

The point which to find the closest vertex to.

Returns
Type Description
Vertex

The closest Vertex.

View Source

GetGraphicInfo(out int, out int, out int, out int, out int)

Declaration
[Obsolete("Use Mesh.GetInfo() instead")]
public void GetGraphicInfo(out int numberOfBodies, out int numberOfFaces, out int numberOfVertices, out int numberOfPrimitives, out int memoryUsage)
Parameters
Type Name Description
int numberOfBodies
int numberOfFaces
int numberOfVertices
int numberOfPrimitives
int memoryUsage
View Source

GetMaterial()

Declaration
public Material GetMaterial()
Returns
Type Description
Material
View Source

GetPhysicsCollisionProperties()

Gets settings for collision detection during physics simulation.

Declaration
public PhysicsCollisionProperties GetPhysicsCollisionProperties()
Returns
Type Description
PhysicsCollisionProperties
View Source

GetPhysicsMaterial()

Gets bulk and surface properties for physics simulation.

Declaration
public PhysicsMaterial GetPhysicsMaterial()
Returns
Type Description
PhysicsMaterial
View Source

GetPhysicsSurfaceVelocity()

Gets properties for physics simulation of surface movement.

Declaration
public PhysicsSurfaceVelocity GetPhysicsSurfaceVelocity()
Returns
Type Description
PhysicsSurfaceVelocity
View Source

IntersectRay(Vector3, Vector3, out Vector3, out Face)

Checks a if ray instersects with this part and return the closest intersection point.

Declaration
public bool IntersectRay(Vector3 rayStart, Vector3 rayDirection, out Vector3 hitPoint, out Face hitFace)
Parameters
Type Name Description
Vector3 rayStart

Starting point of the ray (in global coordinates).

Vector3 rayDirection

Direction of the ray (in global coordinates).

Vector3 hitPoint

Returns the intersection point closest to rayStart.

Face hitFace

Returns the face corresponding to the closest intersection point.

Returns
Type Description
bool

True if the ray intersects with this part, false otherwise.

Remarks

The result is an approximation based on the graphical representation. If the part does not contain geometry, hitFace will be null.

View Source

IntersectVolume(BoundingBox, Matrix4)

Checks if this parts intersects with a volume defined by a BoundingBox.

Declaration
public IntersectionType IntersectVolume(BoundingBox box, Matrix4 boxTransform)
Parameters
Type Name Description
BoundingBox box
Matrix4 boxTransform
Returns
Type Description
IntersectionType
View Source

Load(string)

Loads a part from file.

Declaration
public static Part Load(string fileName)
Parameters
Type Name Description
string fileName

Specifies the file to load.

Returns
Type Description
Part

The loaded Part, or null if the file was loaded successfully but no valid entities were found.

Remarks

Supported file formats are Acis (.sat) and other CAD file formats that have a valid license. Also supports visualization formats such as VRML, STL, JT, 3DS and PLY.

Exceptions
Type Condition
RobotStudioLicenseException

Failed to acquire a valid license for the specified file format.

ApplicationException

Failed to load the file. The exception object contains a description of the problem.

ArgumentNullException
IOException
FileNotFoundException
UnauthorizedAccessException
DirectoryNotFoundException
View Source

Load(string, IProgressCallback, bool, bool, bool, DetailLevels)

Loads a part from file.

Declaration
public static Part Load(string fileName, IProgressCallback progressCallback, bool surfaceModel, bool translateHidden, bool healing, DetailLevels detail)
Parameters
Type Name Description
string fileName

Specifies the file to load.

IProgressCallback progressCallback

An interface that receives notifications about the progress of the load operation.

bool surfaceModel

If true, backfacing surfaces will not be culled when the part is rendered.

bool translateHidden

Controls whether hidden entities are translated or discarded when importing a non-Acis CAD file.

bool healing

Controls whether an attempt is made to automatically heal geometric entitites.

DetailLevels detail

Specifies the detail level(s) to use when creating the graphical representation of geometric entities.

Returns
Type Description
Part

The loaded Part, or null if the file was loaded successfully but no valid entities were found.

Remarks

Supported file formats are Acis (.sat) and other CAD file formats that have a valid license. Also supports visualization formats such as VRML, STL, JT, 3DS and PLY.

Exceptions
Type Condition
RobotStudioLicenseException

Failed to acquire a valid license for the specified file format.

ApplicationException

Failed to load the file. The exception object contains a description of the problem.

ArgumentNullException
IOException
FileNotFoundException
UnauthorizedAccessException
DirectoryNotFoundException
View Source

Load(string, ProgressNotification, bool, DetailLevels)

Loads a part from file.

Declaration
public static Part Load(string fileName, ProgressNotification progressDelegate, bool surfaceModel, DetailLevels detail)
Parameters
Type Name Description
string fileName

Specifies the file to load.

ProgressNotification progressDelegate

A delegate of type ProgressNotification that receives notifications about the progress of the load operation.

bool surfaceModel

If true, backfacing surfaces will not be culled when the part is rendered.

DetailLevels detail

Specifies the detail level(s) to use when creating the graphical representation of geometric entities.

Returns
Type Description
Part

The loaded Part, or null if the file was loaded successfully but no valid entities were found.

Remarks

Supported file formats are Acis (.sat) and other CAD file formats that have a valid license. Also supports visualization formats such as VRML, STL, JT, 3DS and PLY.

Exceptions
Type Condition
RobotStudioLicenseException

Failed to acquire a valid license for the specified file format.

ApplicationException

Failed to load the file. The exception object contains a description of the problem.

ArgumentNullException
IOException
FileNotFoundException
UnauthorizedAccessException
DirectoryNotFoundException
View Source

Load(string, ProgressNotification, bool, bool, bool, DetailLevels)

Loads a part from file.

Declaration
public static Part Load(string fileName, ProgressNotification progressDelegate, bool surfaceModel, bool translateHidden, bool healing, DetailLevels detail)
Parameters
Type Name Description
string fileName

Specifies the file to load.

ProgressNotification progressDelegate

A delegate of type ProgressNotification that receives notifications about the progress of the load operation.

bool surfaceModel

If true, backfacing surfaces will not be culled when the part is rendered.

bool translateHidden

Controls whether hidden entities are translated or discarded when importing a non-Acis CAD file.

bool healing

Controls whether an attempt is made to automatically heal geometric entitites.

DetailLevels detail

Specifies the detail level(s) to use when creating the graphical representation of geometric entities.

Returns
Type Description
Part

The loaded Part, or null if the file was loaded successfully but no valid entities were found.

Remarks

Supported file formats are Acis (.sat) and other CAD file formats that have a valid license. Also supports visualization formats such as VRML, STL, JT, 3DS and PLY.

Exceptions
Type Condition
RobotStudioLicenseException

Failed to acquire a valid license for the specified file format.

ApplicationException

Failed to load the file. The exception object contains a description of the problem.

ArgumentNullException
IOException
FileNotFoundException
UnauthorizedAccessException
DirectoryNotFoundException
View Source

NormalizeTextureCoordinates(bool, bool)

Declaration
public void NormalizeTextureCoordinates(bool u, bool v)
Parameters
Type Name Description
bool u
bool v
View Source

RemoveInternalGeometry()

Reduces the model by removing all bodies and faces in this Part that are not visible from the outside The visible items are found by 'looking' at the part from a number of different directions.

Declaration
public Task RemoveInternalGeometry()
Returns
Type Description
Task
Remarks

Requires an active GraphicControl. Faces will not be removed from the geometric representation, only from the graphics.

View Source

RemoveInternalGeometry(IProgressCallback)

Reduces the model by removing all bodies and faces in this Part that are not visible from the outside The visible items are found by 'looking' at the part from a number of different directions.

Declaration
public Task RemoveInternalGeometry(IProgressCallback progress)
Parameters
Type Name Description
IProgressCallback progress
Returns
Type Description
Task
Remarks

Requires an active GraphicControl. Faces will not be removed from the geometric representation, only from the graphics.

View Source

ReplaceMaterial(Material, Material)

Declaration
public void ReplaceMaterial(Material oldMaterial, Material newMaterial)
Parameters
Type Name Description
Material oldMaterial
Material newMaterial
View Source

SaveAs(string)

Saves (exports) the Part to the specified format.

Declaration
public void SaveAs(string fileName)
Parameters
Type Name Description
string fileName

A string that contains the name of the file to which to save the Part.

View Source

SaveAs(string, int)

Saves (exports) the Part to the specified format.

Declaration
public void SaveAs(string fileName, int version)
Parameters
Type Name Description
string fileName

A string that contains the name of the file to which to save the Part.

int version

The version of the chosen format, if supported (0 means default).

View Source

Scale(double)

Scales this Part uniformly around its origin.

Declaration
public void Scale(double factor)
Parameters
Type Name Description
double factor

Scale factor

View Source

SetMaterial(Material)

Declaration
public void SetMaterial(Material material)
Parameters
Type Name Description
Material material
View Source

SetPhysicsCollisionProperties(PhysicsCollisionProperties)

Sets settings for collision detection during physics simulation.

Declaration
public void SetPhysicsCollisionProperties(PhysicsCollisionProperties geo)
Parameters
Type Name Description
PhysicsCollisionProperties geo
View Source

SetPhysicsMaterial(PhysicsMaterial)

Sets bulk and surface properties for physics simulation.

Declaration
public void SetPhysicsMaterial(PhysicsMaterial material)
Parameters
Type Name Description
PhysicsMaterial material
View Source

SetPhysicsSurfaceVelocity(PhysicsSurfaceVelocity)

Gets properties for physics simulation of surface movement.

Declaration
public void SetPhysicsSurfaceVelocity(PhysicsSurfaceVelocity velocity)
Parameters
Type Name Description
PhysicsSurfaceVelocity velocity

Implements

IHasTransform
IHasFrames
ISupportCopy
IAttachableParent
IAttachableChild
IHasGeometry
  • View Source
In this article
Back to top Copyright © 2025 ABB